Struct qoi::Header [−][src]
pub struct Header {
pub width: u32,
pub height: u32,
pub channels: Channels,
pub colorspace: ColorSpace,
}Expand description
Image header: dimensions, channels, color space.
Notes
A valid image header must satisfy the following conditions:
- Both width and height must be non-zero.
- Maximum number of pixels is 400Mp (=4e8 pixels).
Fields
width: u32Image width in pixels
height: u32Image height in pixels
channels: ChannelsNumber of 8-bit channels per pixel
colorspace: ColorSpaceColor space (informative field, doesn’t affect encoding)
Implementations
Creates a new header and validates image dimensions.
Creates a new header with modified channels.
Creates a new header with modified color space.
Returns the total number of bytes in the raw pixel array.
This may come useful when pre-allocating a buffer to decode the image into.
The maximum number of bytes the encoded image will take.
Can be used to pre-allocate the buffer to encode the image into.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Header
impl UnwindSafe for Header
Blanket Implementations
Mutably borrows from an owned value. Read more