Skip to main content

Module buffer

Module buffer 

Source
Expand description

Full re-export of zenpixels core types (zero module name collisions!). Unparameterized pixel buffers, zero-copy strided views, bands, planes, and dual-layer HDR.

  • PixelBuf owns an alignment-exact PixelStorage, optional HdrMetadata, ColorOrigin, and cached SampleClaims (cleared automatically on &mut).
  • PixelView<'a> and PixelViewMut<'a> borrow rectangular (possibly strided or cropped) subimages with lifetimes tied directly to 'a backing storage.
  • Zero-copy typed pixel access is provided by methods (row_as::<Rgb<u8>>, from_typed, into_vec_zero_copy) rather than a <P = ()> type parameter.
  • BandedBuf handles gigapixel images in bounded-memory horizontal bands.
  • PlanarBuf / PlanarView handle 1..=4 planes (YCbCr, NV12, P010, planar RGB+A) including N-bit BitPacking code extraction.
  • DualLayerHdrBuf carries ISO 21496-1 / UltraHDR base + gain map + headroom metadata.

Structs§

BandMut
Disjoint mutable handle to one horizontal band inside BandedBuf, passed to the closure in BandedBuf::with_bands_mut.
BandRowLocation
Band index and band-local row offset returned by BandedBuf::locate_row.
BandViews
Zero-allocation iterator over every band in a BandedBuf as a borrowed PixelView.
BandedBuf
Gigapixel-safe image stored as compact bounded-size horizontal bands.
Bgrx
4-byte BGR + unused padding pixel (#[repr(C)], align = 1).
DualLayerHdrBuf
Container-agnostic dual-layer HDR image (base + numeric gain map + exact ISO 21496-1 metadata).
DualLayerHdrBufParts
Complete decomposed parts of a DualLayerHdrBuf carrier, preserving every field losslessly.
DualLayerHdrView
Borrowed validated ISO 21496-1 / UltraHDR dual-layer HDR view (zero copy).
InPlaceTransformInput
Current buffer geometry and metadata passed to the closure in PixelBuf::transform_in_place.
InPlaceTransformOutput
Replacement stride and metadata returned by the closure in PixelBuf::transform_in_place.
PixelBuf
Owned, unparameterized, alignment-exact pixel image buffer.
PixelBufParts
Decomposed parts returned by PixelBuf::into_parts.
PixelView
Zero-copy borrowed view of an interleaved image or rectangular crop.
PixelViewMut
Zero-copy mutable view of an interleaved image or rectangular crop.
PlanarBuf
Multi-plane image (YCbCr 4:2:0/4:2:2/4:4:4, NV12, P010, planar RGB+A, planar CMYKA, JXL/TIFF extra planes).
PlanarView
Borrowed multi-plane view (zero heap allocation for 1..=4 planes; spills cleanly for 5..=64 planes).
PlanarViewMut
Mutable borrowed multi-plane view (zero heap allocation for 1..=4 disjoint planes; spills cleanly for 5..=64 planes).
PlaneBuf
Owned single plane inside a PlanarBuf with validated geometry invariants.
PlaneView
Validated borrowed view of one plane inside a PlanarView.
PlaneViewMut
Validated mutable borrowed view of one plane.
Rgbx
4-byte RGB + unused padding pixel (#[repr(C)], align = 1).

Enums§

BandSizing
How BandedBuf partitions image rows into horizontal bands.
BitPackingAccess
Policy controlling how zero-copy typed slice borrowing handles non-BitPacking::Full layouts (e.g. U10_LSB, U12_LSB, P010, Shifted, RGB10A2, RGB565).
BitPackingRead
Policy controlling how read-only row visiting (PixelView::visit_rows_with_packing, PixelBuf::visit_rows_with_packing) handles non-BitPacking::Full layouts.
BitPackingTransform
Policy controlling how scoped in-place row mutation (PixelBuf::mutate_rows_with_packing, PixelViewMut::mutate_rows_with_packing) handles non-BitPacking::Full layouts.
BufFill
Initial pixel fill color for freshly allocated PixelBufs (PixelBuf::new_with_fill, PixelBuf::new_signal_white).
BufferError
Errors returned by pixel buffer, view, band, and plane operations.
InPlaceTransformDecision
Outcome returned by the closure passed to PixelBuf::transform_in_place.
PixelCow
Borrowed-or-owned pixel image returned by zero-copy negotiation / adaptation helpers.

Constants§

DEFAULT_MAX_BAND_BYTES
Default per-band memory cap (16 MiB) for BandedBuf.

Traits§

PixelSink
Uniform write interface across PixelViewMut, PixelBuf, and BandedBuf.
PixelSource
Uniform read interface across PixelView, PixelBuf, and BandedBuf.
TypedElement
Sealed marker trait for Rust scalar, channel-array, or pixel types that carry a known SampleLayout compatibility contract.