pub struct LineParameters {
pub x1: i32,
pub y1: i32,
pub x2: i32,
pub y2: i32,
pub dx: i32,
pub dy: i32,
pub sx: i32,
pub sy: i32,
pub vertical: bool,
pub inc: i32,
pub len: i32,
pub octant: usize,
}Expand description
Parameters describing a line segment for AA rendering.
Port of C++ line_parameters.
Fields§
§x1: i32§y1: i32§x2: i32§y2: i32§dx: i32§dy: i32§sx: i32§sy: i32§vertical: bool§inc: i32§len: i32§octant: usizeImplementations§
Source§impl LineParameters
impl LineParameters
pub fn new(x1: i32, y1: i32, x2: i32, y2: i32, len: i32) -> Self
pub fn orthogonal_quadrant(&self) -> u8
pub fn diagonal_quadrant(&self) -> u8
pub fn same_orthogonal_quadrant(&self, other: &LineParameters) -> bool
pub fn same_diagonal_quadrant(&self, other: &LineParameters) -> bool
Sourcepub fn divide(&self) -> (LineParameters, LineParameters)
pub fn divide(&self) -> (LineParameters, LineParameters)
Split line at midpoint into two halves.
Trait Implementations§
Source§impl Clone for LineParameters
impl Clone for LineParameters
Source§fn clone(&self) -> LineParameters
fn clone(&self) -> LineParameters
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LineParameters
impl Debug for LineParameters
impl Copy for LineParameters
Auto Trait Implementations§
impl Freeze for LineParameters
impl RefUnwindSafe for LineParameters
impl Send for LineParameters
impl Sync for LineParameters
impl Unpin for LineParameters
impl UnwindSafe for LineParameters
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more