#[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. TODO: Make this non_exhaustive before making the type public!
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§
Trait Implementations§
Source§fn clone(&self) -> SharedImageBuffer
fn clone(&self) -> SharedImageBuffer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more