Skip to main content

PlanarViewMut

Struct PlanarViewMut 

Source
pub struct PlanarViewMut<'a> { /* private fields */ }
Expand description

Full re-export of zenpixels core types (zero module name collisions!). 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>

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub const fn width(&self) -> u32

Frame width in pixels.

Source

pub const fn height(&self) -> u32

Frame height in rows.

Source

pub const fn crop_origin(&self) -> (u32, u32)

Crop origin (x, y) in full-resolution parent-frame coordinates.

Source

pub const fn chroma_siting(&self) -> ChromaSiting

Chroma sample siting.

Source

pub fn with_chroma_siting(self, siting: ChromaSiting) -> PlanarViewMut<'a>

Replace chroma sample siting.

Source

pub fn color(&self) -> Option<&ColorSpace>

Optional color interpretation.

Source

pub fn with_color(self, color: ColorSpace) -> PlanarViewMut<'a>

Attach color interpretation.

Source

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.

Source

pub const fn matrix_coefficients(&self) -> Option<MatrixCoefficients>

Optional ITU-T H.273 MatrixCoefficients.

Source

pub fn with_matrix_coefficients( self, matrix: MatrixCoefficients, ) -> PlanarViewMut<'a>

Attach ITU-T H.273 MatrixCoefficients.

Source

pub const fn range_override(&self) -> Option<SignalRange>

Explicit signal range override, if set separately from color.

Source

pub fn effective_range(&self) -> Option<SignalRange>

Effective signal range.

Source

pub fn with_range_override(self, range: SignalRange) -> PlanarViewMut<'a>

Attach an explicit signal range override.

Source

pub const fn alpha_override(&self) -> Option<AlphaMode>

Explicit alpha association override, if set separately from color.

Source

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.

Source

pub fn with_alpha_override(self, alpha: AlphaMode) -> PlanarViewMut<'a>

Attach an explicit alpha association override.

Source

pub fn hdr(&self) -> HdrMetadata

Descriptive HDR container metadata attached to this mutable planar view.

Source

pub fn hdr_ref(&self) -> Option<&HdrMetadata>

Zero-copy reference to attached non-empty HDR metadata (None if empty/unset).

Source

pub fn with_hdr(self, hdr: HdrMetadata) -> PlanarViewMut<'a>

Attach descriptive HDR container metadata.

Source

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()).

Source

pub const fn orientation(&self) -> Orientation

Pending EXIF display orientation attached to this mutable planar view.

Source

pub const fn display_dimensions(&self) -> (u32, u32)

Display-oriented (width, height) after applying orientation.

Source

pub fn with_orientation(self, orientation: Orientation) -> PlanarViewMut<'a>

Replace pending EXIF display orientation.

Source

pub fn set_orientation(&mut self, orientation: Orientation)

Set pending EXIF display orientation in place.

Source

pub fn compose_orientation(self, delta: Orientation) -> PlanarViewMut<'a>

Compose an additional display transform onto pending orientation in O(1).

Source

pub fn planes(&self) -> &[PlaneViewMut<'a>]

Immutable slice of mutable plane views.

Source

pub fn planes_mut(&mut self) -> &mut [PlaneViewMut<'a>]

Mutable slice of all disjoint planes (allows simultaneous mutable access via split_at_mut).

Source

pub fn plane_mut(&mut self, index: usize) -> Option<&mut PlaneViewMut<'a>>

Mutably borrow plane index.

Source

pub fn plane_by_role(&self, role: PlaneRole) -> Option<&PlaneViewMut<'a>>

Look up the first plane matching role immutably.

Source

pub fn plane_by_role_mut( &mut self, role: PlaneRole, ) -> Option<&mut PlaneViewMut<'a>>

Look up the first plane matching role mutably.

Source

pub fn as_view(&self) -> PlanarView<'_>

Borrow all planes immutably as a PlanarView.

Source

pub fn try_as_view(&self) -> Result<PlanarView<'_>, At<BufferError>>

Fallibly borrow all planes immutably as a PlanarView.

Source

pub fn into_view(self) -> Result<PlanarView<'a>, At<BufferError>>

Downgrade into an immutable PlanarView<'a> retaining 'a.

Source

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).

Source

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).

Source

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.

Source

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<'_>

Source

pub fn hash_with(&self, inclusions: HashInclusions) -> u64

Compute a portable, endian- and stride-independent XXH3 fingerprint of this mutable planar view.

Trait Implementations§

Source§

impl<'a> Debug for PlanarViewMut<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for PlanarViewMut<'a>

§

impl<'a> Freeze for PlanarViewMut<'a>

§

impl<'a> RefUnwindSafe for PlanarViewMut<'a>

§

impl<'a> Send for PlanarViewMut<'a>

§

impl<'a> Sync for PlanarViewMut<'a>

§

impl<'a> Unpin for PlanarViewMut<'a>

§

impl<'a> UnsafeUnpin for PlanarViewMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.