pub struct RasterizerOutline<'a, Ren: RendererPrimitivesLike> { /* private fields */ }Expand description
Outline rasterizer.
Reads vertices from a VertexSource and feeds them directly to a
primitive renderer. No anti-aliasing or scanline conversion — just
Bresenham lines.
Port of C++ rasterizer_outline<Renderer>.
Implementations§
Source§impl<'a, Ren: RendererPrimitivesLike> RasterizerOutline<'a, Ren>
impl<'a, Ren: RendererPrimitivesLike> RasterizerOutline<'a, Ren>
pub fn new(ren: &'a mut Ren) -> Self
Sourcepub fn move_to_d(&mut self, x: f64, y: f64)
pub fn move_to_d(&mut self, x: f64, y: f64)
Move to a floating-point position (converts to subpixel).
Sourcepub fn line_to_d(&mut self, x: f64, y: f64)
pub fn line_to_d(&mut self, x: f64, y: f64)
Draw a line to a floating-point position (converts to subpixel).
Sourcepub fn add_vertex(&mut self, x: f64, y: f64, cmd: u32)
pub fn add_vertex(&mut self, x: f64, y: f64, cmd: u32)
Add a single vertex with a path command.
Sourcepub fn add_path<VS: VertexSource>(&mut self, vs: &mut VS, path_id: u32)
pub fn add_path<VS: VertexSource>(&mut self, vs: &mut VS, path_id: u32)
Add all vertices from a vertex source.
Sourcepub fn render_all_paths<VS: VertexSource>(
&mut self,
vs: &mut VS,
colors: &[Ren::Color],
path_ids: &[u32],
)
pub fn render_all_paths<VS: VertexSource>( &mut self, vs: &mut VS, colors: &[Ren::Color], path_ids: &[u32], )
Render multiple paths with different colors.
Auto Trait Implementations§
impl<'a, Ren> Freeze for RasterizerOutline<'a, Ren>
impl<'a, Ren> RefUnwindSafe for RasterizerOutline<'a, Ren>where
Ren: RefUnwindSafe,
impl<'a, Ren> Send for RasterizerOutline<'a, Ren>where
Ren: Send,
impl<'a, Ren> Sync for RasterizerOutline<'a, Ren>where
Ren: Sync,
impl<'a, Ren> Unpin for RasterizerOutline<'a, Ren>
impl<'a, Ren> !UnwindSafe for RasterizerOutline<'a, Ren>
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