Enum piet_common::ImageFormat [−][src]
#[non_exhaustive]
pub enum ImageFormat {
Grayscale,
Rgb,
RgbaSeparate,
RgbaPremul,
}
Expand description
The pixel format for bitmap images.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
1 byte per pixel.
For example, a white pixel has value 0xff.
3 bytes per pixel, in RGB order.
For example, a red pixel consists of three bytes [0xff, 0, 0]
independent of the system’s
endianness.
4 bytes per pixel, in RGBA order, with separate alpha.
For example, a full-intensity red pixel with 50% transparency consists of four bytes
[0xff, 0, 0, 0x80]
independent of the system’s endianness.
4 bytes per pixel, in RGBA order, with premultiplied alpha.
For example, a full-intensity red pixel with 50% transparency consists of four bytes
[0x80, 0, 0, 0x80]
independent of the system’s endianness.
Implementations
The number of bytes required to represent a pixel in this format.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
Blanket Implementations
Mutably borrows from an owned value. Read more
Performs the conversion.
Performs the conversion.