Struct font_kit::canvas::Canvas [−][src]
pub struct Canvas { pub pixels: Vec<u8>, pub size: Vector2I, pub stride: usize, pub format: Format, }
Expand description
An in-memory bitmap surface for glyph rasterization.
Fields
pixels: Vec<u8>
The raw pixel data.
size: Vector2I
The size of the buffer, in pixels.
stride: usize
The number of bytes between successive rows.
format: Format
The image format of the canvas.
Implementations
Creates a new blank canvas with the given pixel size and format.
Stride is automatically calculated from width.
The canvas is initialized with transparent black (all values 0).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Canvas
impl UnwindSafe for Canvas