pub struct Rasterizer { /* private fields */ }Expand description
A scanline rasterizer that owns reusable scratch buffers so per-polygon heap allocation is avoided.
Use Rasterizer::fill_polygon / Rasterizer::fill_polygon_clipped
in performance-critical loops. The free-standing functions in this module
delegate here and are kept for API stability.
Implementations§
Source§impl Rasterizer
impl Rasterizer
Sourcepub fn fill_polygon(
&mut self,
fb: &mut Framebuffer,
points: &[(f32, f32)],
color: Color,
fill_rule: FillRule,
aa: bool,
)
pub fn fill_polygon( &mut self, fb: &mut Framebuffer, points: &[(f32, f32)], color: Color, fill_rule: FillRule, aa: bool, )
Fill a polygon into fb, reusing internal scratch buffers.
Sourcepub fn fill_polygon_clipped(
&mut self,
fb: &mut Framebuffer,
points: &[(f32, f32)],
color: Color,
fill_rule: FillRule,
aa: bool,
clip: ClipRect,
)
pub fn fill_polygon_clipped( &mut self, fb: &mut Framebuffer, points: &[(f32, f32)], color: Color, fill_rule: FillRule, aa: bool, clip: ClipRect, )
Fill a polygon into fb, clipped to clip, reusing internal scratch.
Trait Implementations§
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