Expand description
HAL pixel format, as reported in TensorDesc::format.
Same ABI concern as [dtype]: these codes cross a package boundary, so
they are appended, never reordered. crate::PixelFormat itself
generates this module’s per-variant constants (via ef_vocabulary!, see
vocabulary.rs), so this and crate::PixelFormat::code are two views
of the same declared literal per variant, not two hand-kept tables that
could drift apart. format::NONE is the one constant this module adds
beyond what the macro emits – see its own doc.
This exists because TensorDesc::fourcc cannot represent every HAL
format: PlanarRgb/PlanarRgba have no standard FourCC and both encode
as fourcc = 0, the same sentinel a non-image tensor uses, so fourcc
alone cannot tell “Planar RGB” apart from “no format”. fourcc stays for
third-party/DRM interop; a HAL-aware consumer prefers format and
falls back to fourcc only when format is 0.
protocol::format is the canonical, documented path – the source
module, crate::pixel_format_wire, is #[doc(hidden)] because it exists
only so this re-export has something public to alias; it is emission
plumbing, not a second API for the same codes.
Constants§
- BGRA
- GREY
- NONE
- No format (non-image tensor), or a format this build predates. Not a
crate::PixelFormatvariant – every code1..=11below is one of those, generated by the sameef_vocabulary!declaration ascrate::PixelFormat::code;0is a sentinel this module alone defines, since “no format” has no corresponding Rust variant. - NV12
- NV16
- NV24
- PLANAR_
RGB - PLANAR_
RGBA - RGB
- RGBA
- VYUY
- YUYV