pub struct Rasterizer { /* private fields */ }Expand description
Accumulation-buffer scanline rasterizer producing an A8 coverage bitmap of a
fixed width × height.
Implementations§
Source§impl Rasterizer
impl Rasterizer
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Create a rasterizer for a width × height coverage bitmap.
Sourcepub fn line(&mut self, x0: f32, y0: f32, x1: f32, y1: f32)
pub fn line(&mut self, x0: f32, y0: f32, x1: f32, y1: f32)
Add a straight edge between two points in pixel coordinates.
Edges may be supplied in any order; their signed contributions combine so that a closed contour yields correct non-zero-winding coverage.
Sourcepub fn quad(&mut self, x0: f32, y0: f32, cx: f32, cy: f32, x1: f32, y1: f32)
pub fn quad(&mut self, x0: f32, y0: f32, cx: f32, cy: f32, x1: f32, y1: f32)
Add a quadratic Bézier, flattened to line segments.
Auto Trait Implementations§
impl Freeze for Rasterizer
impl RefUnwindSafe for Rasterizer
impl Send for Rasterizer
impl Sync for Rasterizer
impl Unpin for Rasterizer
impl UnsafeUnpin for Rasterizer
impl UnwindSafe for Rasterizer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more