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).

Creates a new blank canvas with the given pixel size, stride (number of bytes between successive rows), and format.

The canvas is initialized with transparent black (all values 0).

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.