pub struct DecodedFrame { /* private fields */ }Expand description
The validated output of a HwStillDecoder: a decoded 4:2:0 (or
monochrome-in-4:2:0) picture in one of the four platform surface layouts.
Construct with DecodedFrame::new, which checks the plane count and
every plane’s geometry against format/width/height, and the
bit_depth against the format’s sample width — an internally inconsistent
frame is unrepresentable, so consumers can trust the plane sizes.
Implementations§
Source§impl DecodedFrame
impl DecodedFrame
Sourcepub fn new(
format: PixelFormat,
width: u32,
height: u32,
bit_depth: u8,
range: ColorRange,
planes: Vec<Plane>,
) -> Result<Self, HwDecodeError>
pub fn new( format: PixelFormat, width: u32, height: u32, bit_depth: u8, range: ColorRange, planes: Vec<Plane>, ) -> Result<Self, HwDecodeError>
Builds a frame from its planes, validating internal consistency.
width/height are the luma dimensions (post conformance-window
crop). Chroma planes use ceiling division on the subsampled axes.
§Errors
Returns HwDecodeError::InvalidFrame if either dimension is zero,
bit_depth does not fit format (see
PixelFormat::supports_bit_depth), the plane count is wrong, a
stride is smaller than the row’s used width, or a plane buffer is too
short for its rows.
Sourcepub fn format(&self) -> PixelFormat
pub fn format(&self) -> PixelFormat
The pixel layout of the planes.
Sourcepub fn bit_depth(&self) -> u8
pub fn bit_depth(&self) -> u8
The per-sample bit depth (8 for NV12/I420, 9..=16 for P010/I010).
Sourcepub fn range(&self) -> ColorRange
pub fn range(&self) -> ColorRange
The signal range of the samples (limited/studio vs full swing).