rust/integral-geometry/src/lib.rs
changeset 14056 8a0d69c16cad
parent 13955 48796bef9e69
child 14057 9c817b2eedae
equal deleted inserted replaced
14055:4b40bdd214df 14056:8a0d69c16cad
    70 bin_op_impl!(Div, div);
    70 bin_op_impl!(Div, div);
    71 bin_assign_op_impl!(AddAssign, add_assign);
    71 bin_assign_op_impl!(AddAssign, add_assign);
    72 bin_assign_op_impl!(SubAssign, sub_assign);
    72 bin_assign_op_impl!(SubAssign, sub_assign);
    73 bin_assign_op_impl!(MulAssign, mul_assign);
    73 bin_assign_op_impl!(MulAssign, mul_assign);
    74 bin_assign_op_impl!(DivAssign, div_assign);
    74 bin_assign_op_impl!(DivAssign, div_assign);
       
    75 
       
    76 #[derive(PartialEq, Eq, Clone, Copy, Debug)]
       
    77 pub struct Rect {
       
    78     pub x: i32,
       
    79     pub y: i32,
       
    80     pub width: u32,
       
    81     pub height: u32,
       
    82 }
       
    83 
       
    84 impl Rect {
       
    85     #[inline]
       
    86     pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self {
       
    87         Self { x, y, width, height }
       
    88     }
       
    89 }
       
    90 
    75 
    91 
    76 pub struct LinePoints {
    92 pub struct LinePoints {
    77     accumulator: Point,
    93     accumulator: Point,
    78     direction: Point,
    94     direction: Point,
    79     sign: Point,
    95     sign: Point,