#[repr(C)]
pub enum SharedImageBuffer {
    RGB8(SharedPixelBuffer<Rgb8Pixel>),
    RGBA8(SharedPixelBuffer<Rgba8Pixel>),
    RGBA8Premultiplied(SharedPixelBuffer<Rgba8Pixel>),
}
Expand description

SharedImageBuffer is a container for images that are stored in CPU accessible memory.

The SharedImageBuffer’s variants represent the different common formats for encoding images in pixels.

Variants§

§

RGB8(SharedPixelBuffer<Rgb8Pixel>)

This variant holds the data for an image where each pixel has three color channels (red, green, and blue) and each channel is encoded as unsigned byte.

§

RGBA8(SharedPixelBuffer<Rgba8Pixel>)

This variant holds the data for an image where each pixel has four color channels (red, green, blue and alpha) and each channel is encoded as unsigned byte.

§

RGBA8Premultiplied(SharedPixelBuffer<Rgba8Pixel>)

This variant holds the data for an image where each pixel has four color channels (red, green, blue and alpha) and each channel is encoded as unsigned byte. In contrast to Self::RGBA8, this variant assumes that the alpha channel is also already multiplied to each red, green and blue component of each pixel. Only construct this format if you know that your pixels are encoded this way. It is more efficient for rendering.

Implementations§

Returns the width of the image in pixels.

Returns the height of the image in pixels.

Returns the size of the image in pixels.

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.