Struct tiny_skia::Pixmap[][src]

pub struct Pixmap { /* fields omitted */ }
Expand description

A container that owns premultiplied RGBA pixels.

The data is not aligned, therefore width == stride.

Implementations

Allocates a new pixmap.

A pixmap is filled with transparent black by default, aka (0, 0, 0, 0).

Zero size in an error.

Pixmap’s width is limited by i32::MAX/4.

Decodes a PNG data into a Pixmap.

Only 8-bit images are supported. Index PNGs are not supported.

Loads a PNG file into a Pixmap.

Only 8-bit images are supported. Index PNGs are not supported.

Encodes pixmap into a PNG data.

Saves pixmap as a PNG file.

Returns a container that references Pixmap’s data.

Returns a container that references Pixmap’s data.

Returns pixmap’s width.

Returns pixmap’s height.

Fills the entire pixmap with a specified color.

Returns the internal data.

Byteorder: RGBA

Returns the mutable internal data.

Byteorder: RGBA

Returns a pixel color.

Returns None when position is out of bounds.

Returns a mutable slice of pixels.

Returns a slice of pixels.

Consumes the internal data.

Byteorder: RGBA

Returns a copy of the pixmap that intersects the rect.

Returns None when Pixmap’s rect doesn’t contain rect.

Draws a filled rectangle onto the pixmap.

See PixmapMut::fill_rect for details.

Draws a filled path onto the pixmap.

See PixmapMut::fill_path for details.

Strokes a path.

See PixmapMut::stroke_path for details.

Draws a Pixmap on top of the current Pixmap.

See PixmapMut::draw_pixmap for details.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.