pub trait Layout {
    fn byte_len(&self) -> usize;
}
Expand description

A descriptor of the layout of image bytes.

There is no color space and no strict type interpretation here, just some mapping to required bytes for such a fixed buffer and a width and height of the described image. This means that the byte usage for a particular buffer needs to be independent of the content, in particular can not be based on compressibility.

There is one more thing that differentiates an image from an encoded format. It is expected that the image can be unfolded into some matrix of independent pixels (with potentially multiple channels) without any arithmetic or conversion function. Independent here means that, when supplied with the missing color space and type information, there should exist an Fn(U) -> T that can map these pixels independently into some linear color space.

This property holds for any packed, strided or planar RGB/YCbCr/HSV format as well as chroma subsampled YUV images and even raw Bayer filtered images.

Required Methods

Implementations on Foreign Types

Implementors