DebugRasterizer

Struct DebugRasterizer 

Source
pub struct DebugRasterizer { /* private fields */ }
Expand description

A debug rasterizer

This simply collections all rasterizations into a paint list

Implementations§

Source§

impl DebugRasterizer

Source

pub fn into_paint_list(self) -> Vec<(ViewId, Shape)>

Get the paint list for the rasterization phase

Trait Implementations§

Source§

impl Default for DebugRasterizer

Source§

fn default() -> DebugRasterizer

Returns the “default value” for a type. Read more
Source§

impl Rasterizer for DebugRasterizer

Source§

fn begin(&mut self, id: ViewId)

Start a new shape with an provided id
Source§

fn set_rect(&mut self, rect: Rect)

Sets the region for this rasterizer to use
Source§

fn rect(&self) -> Rect

The region that this rasterizer is using
Source§

fn clear(&mut self, _color: Rgba)

Clear the entire region with a color
Source§

fn fill_bg(&mut self, color: Rgba)

Fill the background of the region with a color
Source§

fn fill_with(&mut self, pixel: Pixel)

Fill the background of the region with a pixel
Source§

fn line( &mut self, axis: Axis, offset: Pos2, range: RangeInclusive<i32>, pixel: Pixel, )

Draws a line in a specific orientation starting an offset x0,x1..=y0,y1 using the provided pixel
Source§

fn text(&mut self, shape: TextShape<'_>)

Draws a TextShape into the region
Source§

fn pixel(&mut self, pos: Pos2, pixel: Pixel)

Sets a pixel as a specific position
Source§

fn grapheme(&mut self, pos: Pos2, grapheme: Grapheme)

Sets a grapheme as a specific position
Source§

fn get_mut(&mut self, _pos: Pos2) -> Option<&mut Cell>

Tries to get a cell at a specific position
Source§

fn end(&mut self, _id: ViewId)

End the current shape with the provided id
Source§

fn horizontal_line(&mut self, y: i32, range: RangeInclusive<i32>, pixel: Pixel)

Draw a horizontal line at the y offset between x0..=x1 using the provided pixel
Source§

fn vertical_line(&mut self, x: i32, range: RangeInclusive<i32>, pixel: Pixel)

Draw a vertical line at the x offset between y0..=y1 using the provided pixel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.