pub struct PlanarViewMut<'a> { /* private fields */ }Expand description
Mutable borrowed multi-plane view (zero heap allocation for 1..=4 disjoint planes; spills
cleanly for 5..=64 planes).
Implementations§
Source§impl<'a> PlanarViewMut<'a>
impl<'a> PlanarViewMut<'a>
Sourcepub fn new(
width: u32,
height: u32,
planes: Vec<PlaneViewMut<'a>>,
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn new( width: u32, height: u32, planes: Vec<PlaneViewMut<'a>>, ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Construct a validated mutable multi-plane view from caller-owned PlaneViewMuts.
Sourcepub fn new_with_crop_origin(
width: u32,
height: u32,
crop_origin: (u32, u32),
chroma_siting: ChromaSiting,
planes: Vec<PlaneViewMut<'a>>,
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn new_with_crop_origin( width: u32, height: u32, crop_origin: (u32, u32), chroma_siting: ChromaSiting, planes: Vec<PlaneViewMut<'a>>, ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Construct a validated mutable multi-plane view with explicit crop_origin and ChromaSiting.
Sourcepub fn from_array<const N: usize>(
width: u32,
height: u32,
planes: [PlaneViewMut<'a>; N],
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn from_array<const N: usize>( width: u32, height: u32, planes: [PlaneViewMut<'a>; N], ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Construct a validated mutable multi-plane view from a fixed array of 1..=4 disjoint
planes with zero heap allocation.
Sourcepub fn from_array_with_crop_origin<const N: usize>(
width: u32,
height: u32,
crop_origin: (u32, u32),
chroma_siting: ChromaSiting,
planes: [PlaneViewMut<'a>; N],
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn from_array_with_crop_origin<const N: usize>( width: u32, height: u32, crop_origin: (u32, u32), chroma_siting: ChromaSiting, planes: [PlaneViewMut<'a>; N], ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Construct a validated mutable multi-plane view from a fixed array of planes with explicit
crop_origin and ChromaSiting (zero heap allocation for 1..=4 planes).
Sourcepub const fn crop_origin(&self) -> (u32, u32)
pub const fn crop_origin(&self) -> (u32, u32)
Crop origin (x, y) in full-resolution parent-frame coordinates.
Sourcepub const fn chroma_siting(&self) -> ChromaSiting
pub const fn chroma_siting(&self) -> ChromaSiting
Chroma sample siting.
Sourcepub fn with_chroma_siting(self, siting: ChromaSiting) -> PlanarViewMut<'a>
pub fn with_chroma_siting(self, siting: ChromaSiting) -> PlanarViewMut<'a>
Replace chroma sample siting.
Sourcepub fn color(&self) -> Option<&ColorSpace>
pub fn color(&self) -> Option<&ColorSpace>
Optional color interpretation.
Sourcepub fn with_color(self, color: ColorSpace) -> PlanarViewMut<'a>
pub fn with_color(self, color: ColorSpace) -> PlanarViewMut<'a>
Attach color interpretation.
Sourcepub fn with_color_ref(self, color: &'a ColorSpace) -> PlanarViewMut<'a>
pub fn with_color_ref(self, color: &'a ColorSpace) -> PlanarViewMut<'a>
Borrow color interpretation onto this mutable planar view with zero heap allocation and zero atomic refcount overhead.
Sourcepub const fn matrix_coefficients(&self) -> Option<MatrixCoefficients>
pub const fn matrix_coefficients(&self) -> Option<MatrixCoefficients>
Optional ITU-T H.273 MatrixCoefficients.
Sourcepub fn with_matrix_coefficients(
self,
matrix: MatrixCoefficients,
) -> PlanarViewMut<'a>
pub fn with_matrix_coefficients( self, matrix: MatrixCoefficients, ) -> PlanarViewMut<'a>
Attach ITU-T H.273 MatrixCoefficients.
Sourcepub const fn range_override(&self) -> Option<SignalRange>
pub const fn range_override(&self) -> Option<SignalRange>
Explicit signal range override, if set separately from color.
Sourcepub fn effective_range(&self) -> Option<SignalRange>
pub fn effective_range(&self) -> Option<SignalRange>
Effective signal range.
Sourcepub fn with_range_override(self, range: SignalRange) -> PlanarViewMut<'a>
pub fn with_range_override(self, range: SignalRange) -> PlanarViewMut<'a>
Attach an explicit signal range override.
Sourcepub const fn alpha_override(&self) -> Option<AlphaMode>
pub const fn alpha_override(&self) -> Option<AlphaMode>
Explicit alpha association override, if set separately from color.
Sourcepub fn effective_alpha(&self) -> Option<AlphaMode>
pub fn effective_alpha(&self) -> Option<AlphaMode>
Plane-aware effective alpha association mode.
Returns None when no PlaneRole::Alpha (or PlaneRole::Packed) plane is present.
Otherwise checks alpha_override first and falls back to
color’s alpha mode, ignoring AlphaMode::None / AlphaMode::Undefined.
Sourcepub fn with_alpha_override(self, alpha: AlphaMode) -> PlanarViewMut<'a>
pub fn with_alpha_override(self, alpha: AlphaMode) -> PlanarViewMut<'a>
Attach an explicit alpha association override.
Sourcepub fn hdr(&self) -> HdrMetadata
pub fn hdr(&self) -> HdrMetadata
Descriptive HDR container metadata attached to this mutable planar view.
Sourcepub fn hdr_ref(&self) -> Option<&HdrMetadata>
pub fn hdr_ref(&self) -> Option<&HdrMetadata>
Zero-copy reference to attached non-empty HDR metadata (None if empty/unset).
Sourcepub fn with_hdr(self, hdr: HdrMetadata) -> PlanarViewMut<'a>
pub fn with_hdr(self, hdr: HdrMetadata) -> PlanarViewMut<'a>
Attach descriptive HDR container metadata.
Sourcepub fn with_hdr_ref(self, hdr: &'a HdrMetadata) -> PlanarViewMut<'a>
pub fn with_hdr_ref(self, hdr: &'a HdrMetadata) -> PlanarViewMut<'a>
Borrow descriptive HDR container metadata onto this mutable planar view with zero heap
allocation and zero atomic refcount overhead (ignores empty HdrMetadata::default()).
Sourcepub const fn orientation(&self) -> Orientation
pub const fn orientation(&self) -> Orientation
Pending EXIF display orientation attached to this mutable planar view.
Sourcepub const fn display_dimensions(&self) -> (u32, u32)
pub const fn display_dimensions(&self) -> (u32, u32)
Display-oriented (width, height) after applying orientation.
Sourcepub fn with_orientation(self, orientation: Orientation) -> PlanarViewMut<'a>
pub fn with_orientation(self, orientation: Orientation) -> PlanarViewMut<'a>
Replace pending EXIF display orientation.
Sourcepub fn set_orientation(&mut self, orientation: Orientation)
pub fn set_orientation(&mut self, orientation: Orientation)
Set pending EXIF display orientation in place.
Sourcepub fn compose_orientation(self, delta: Orientation) -> PlanarViewMut<'a>
pub fn compose_orientation(self, delta: Orientation) -> PlanarViewMut<'a>
Compose an additional display transform onto pending orientation in O(1).
Sourcepub fn planes(&self) -> &[PlaneViewMut<'a>]
pub fn planes(&self) -> &[PlaneViewMut<'a>]
Immutable slice of mutable plane views.
Sourcepub fn planes_mut(&mut self) -> &mut [PlaneViewMut<'a>]
pub fn planes_mut(&mut self) -> &mut [PlaneViewMut<'a>]
Mutable slice of all disjoint planes (allows simultaneous mutable access via split_at_mut).
Sourcepub fn plane_mut(&mut self, index: usize) -> Option<&mut PlaneViewMut<'a>>
pub fn plane_mut(&mut self, index: usize) -> Option<&mut PlaneViewMut<'a>>
Mutably borrow plane index.
Sourcepub fn plane_by_role(&self, role: PlaneRole) -> Option<&PlaneViewMut<'a>>
pub fn plane_by_role(&self, role: PlaneRole) -> Option<&PlaneViewMut<'a>>
Look up the first plane matching role immutably.
Sourcepub fn plane_by_role_mut(
&mut self,
role: PlaneRole,
) -> Option<&mut PlaneViewMut<'a>>
pub fn plane_by_role_mut( &mut self, role: PlaneRole, ) -> Option<&mut PlaneViewMut<'a>>
Look up the first plane matching role mutably.
Sourcepub fn as_view(&self) -> PlanarView<'_>
pub fn as_view(&self) -> PlanarView<'_>
Borrow all planes immutably as a PlanarView.
Sourcepub fn try_as_view(&self) -> Result<PlanarView<'_>, At<BufferError>>
pub fn try_as_view(&self) -> Result<PlanarView<'_>, At<BufferError>>
Fallibly borrow all planes immutably as a PlanarView.
Sourcepub fn into_view(self) -> Result<PlanarView<'a>, At<BufferError>>
pub fn into_view(self) -> Result<PlanarView<'a>, At<BufferError>>
Downgrade into an immutable PlanarView<'a> retaining 'a.
Sourcepub fn crop_mut(
&mut self,
rect: PixelRect,
) -> Result<PlanarViewMut<'_>, At<BufferError>>
pub fn crop_mut( &mut self, rect: PixelRect, ) -> Result<PlanarViewMut<'_>, At<BufferError>>
Zero-copy mutable rectangular crop of all planes preserving exact parent-frame chroma
phase even for odd (x, y) origins on 4:2:0 / 4:2:2 subsampled frames (zero heap
allocation for <= 4 planes).
Sourcepub fn into_crop(
self,
rect: PixelRect,
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn into_crop( self, rect: PixelRect, ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Consume this mutable multi-plane view and narrow it to a rectangular crop retaining 'a
(zero heap allocation for <= 4 planes).
Sourcepub fn sub_rows_mut(
&mut self,
start_y: u32,
row_count: u32,
) -> Result<PlanarViewMut<'_>, At<BufferError>>
pub fn sub_rows_mut( &mut self, start_y: u32, row_count: u32, ) -> Result<PlanarViewMut<'_>, At<BufferError>>
Zero-copy mutable full-width horizontal strip of all planes preserving parent-frame chroma phase.
Sourcepub fn into_sub_rows(
self,
start_y: u32,
row_count: u32,
) -> Result<PlanarViewMut<'a>, At<BufferError>>
pub fn into_sub_rows( self, start_y: u32, row_count: u32, ) -> Result<PlanarViewMut<'a>, At<BufferError>>
Consume this mutable multi-plane view and narrow it to a full-width horizontal strip
retaining 'a.
Source§impl PlanarViewMut<'_>
impl PlanarViewMut<'_>
Sourcepub fn hash_with(&self, inclusions: HashInclusions) -> u64
pub fn hash_with(&self, inclusions: HashInclusions) -> u64
Compute a portable, endian- and stride-independent XXH3 fingerprint of this mutable planar view.