Skip to main content

Module buffer

Module buffer 

Source
Expand description

Opaque pixel buffer abstraction.

Provides format-aware pixel storage that carries its own metadata: PixelBuffer (owned), PixelSlice (borrowed, immutable), and PixelSliceMut (borrowed, mutable).

These types track pixel format via PixelDescriptor and color context via ColorContext.

Typed variants (e.g., PixelBuffer<Rgb<u8>>) enforce format correctness at compile time through the Pixel trait. Use erase() to convert to a type-erased form, or try_typed() to go back.

For format conversions (e.g., convert_to, to_rgb8), see the zenpixels-convert crate which provides PixelBufferConvertExt.

Structs§

Bgrx
32-bit BGR pixel with padding byte (BGRx).
PixelBuffer
Owned pixel buffer with format metadata.
PixelSlice
Borrowed view of pixel data.
PixelSliceMut
Mutable borrowed view of pixel data.
Rgbx
32-bit RGB pixel with padding byte (RGBx).

Enums§

BufferError
Errors from pixel buffer operations.

Traits§

Pixel
Compile-time pixel format descriptor.