Expand description
Core traits, image buffers, dimensions, and error types shared across the gamut codecs.
This crate is dependency-free with respect to the format crates: every codec in the
workspace builds on the EncodeImage / DecodeImage traits, the branded ImageRef /
ImageBuf buffers, and the Error type defined here, so that callers get a single,
consistent error surface regardless of format.
Structs§
- Bilevel
- 8-bit bilevel: one byte per pixel,
0= black and non-zero = white. Distinct fromGray8so a grayscale buffer cannot be mistaken for a 1-bit image. - Cmyk8
- 8-bit CMYK: four interleaved ink bytes per pixel. Distinct from
Rgba8despite the shared channel count. - Dimensions
- Width and height of an image, in pixels.
- Gray8
- 8-bit grayscale: one luminance byte per pixel.
- Gray16
- 16-bit grayscale: one
u16luminance sample per pixel (high-bit-depth). - Image
Buf - An owned, length-validated interleaved image of pixel type
P. - Image
Ref - A borrowed, length-validated view of an interleaved image of pixel type
P. - Indexed8
- 8-bit palette indices: one index byte per pixel into a separate colour table. Distinct from
Gray8so indices cannot be mistaken for luminance. - Rgb8
- 8-bit RGB: three interleaved bytes per pixel, row-major.
- Rgb16
- 16-bit RGB: three interleaved
u16samples per pixel (high-bit-depth). - Rgba8
- 8-bit RGBA: four interleaved bytes per pixel (unassociated alpha).
- Rgba16
- 16-bit RGBA: four interleaved
u16samples per pixel (high-bit-depth).
Enums§
- Color
Model - The colour interpretation of a pixel’s channels.
- Error
- Errors produced by gamut encoders and decoders.
Traits§
- Decode
Image - Decodes a compressed byte stream into an owned
ImageBufof pixel layoutP. - Encode
Image - Encodes an
ImageRefof a specific pixel layoutPinto a compressed byte stream. - Pixel
- Compile-time description of one interleaved pixel layout.
- Sample
- A pixel-sample storage primitive:
u8(8-bit) oru16(10/12/16-bit, high-bit-depth).
Type Aliases§
- Result
- Convenience result type for gamut operations.