Struct av_metrics_decoders::Plane [−]
pub struct Plane<T> where
T: Pixel, {
pub data: PlaneData<T>,
pub cfg: PlaneConfig,
}
Expand description
One data plane of a frame.
For example, a plane can be a Y luma plane or a U or V chroma plane.
Fields
data: PlaneData<T>
cfg: PlaneConfig
Plane configuration.
Implementations
Allocates and returns a new plane.
pub fn from_slice(data: &[T], stride: usize) -> Plane<T>
pub fn probe_padding(&self, w: usize, h: usize) -> bool
pub fn probe_padding(&self, w: usize, h: usize) -> bool
Minimally test that the plane has been padded.
pub fn slice(&self, po: PlaneOffset) -> PlaneSlice<'_, T>
pub fn mut_slice(&mut self, po: PlaneOffset) -> PlaneMutSlice<'_, T>
Returns plane data starting from the origin.
Returns mutable plane data starting from the origin.
Copies data into the plane from a pixel array.
Copies data from a plane into a pixel array.
pub fn downsampled(&self, frame_width: usize, frame_height: usize) -> Plane<T>
pub fn downsampled(&self, frame_width: usize, frame_height: usize) -> Plane<T>
Returns plane with half the resolution for width and height. Downscaled with 2x2 box filter. Padded to dimensions with frame_width and frame_height.
Returns a plane downscaled from the source plane by a factor of scale
(not padded)
pub fn downscale_in_place(&self, scale: usize, in_plane: &mut Plane<T>)
pub fn downscale_in_place(&self, scale: usize, in_plane: &mut Plane<T>)
Downscales the source plane by a factor of scale
, writing the result to in_plane
(not padded)
in_plane
’s width and height must be sufficient for scale
.
pub fn iter(&self) -> PlaneIter<'_, T>
pub fn iter(&self) -> PlaneIter<'_, T>
Iterates over the pixels in the plane, skipping the padding.
pub fn rows_iter(&self) -> RowsIter<'_, T>
pub fn rows_iter(&self) -> RowsIter<'_, T>
Iterates over the lines of the plane
Trait Implementations
impl<T> StructuralEq for Plane<T> where
T: Pixel,
impl<T> StructuralPartialEq for Plane<T> where
T: Pixel,
Auto Trait Implementations
impl<T> RefUnwindSafe for Plane<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Plane<T> where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more