pub trait PixelFormat:
Sealed
+ Copy
+ 'static {
type Sample: Sample;
const CHANNELS: Channels;
const COLOR_SPACE: ColorSpace;
const BIT_DEPTH: BitDepth;
}Expand description
A compile-time description of how an Image’s pixels are
laid out and interpreted.
Every implementor is a zero-sized marker type. Because
Image is generic over this trait, the color space,
channel layout, and bit depth of an image all live in its type, so a
metric can reject mismatched inputs at compile time.
This trait is sealed; the crate defines every valid format, so downstream code cannot introduce nonsensical combinations.
Required Associated Constants§
Sourceconst COLOR_SPACE: ColorSpace
const COLOR_SPACE: ColorSpace
Color space the samples are encoded in.
Sourceconst BIT_DEPTH: BitDepth
const BIT_DEPTH: BitDepth
Bits per sample (mirrors Sample::BIT_DEPTH for convenience).
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".