Skip to main content

PlanarCapturePlan

Struct PlanarCapturePlan 

Source
pub struct PlanarCapturePlan { /* private fields */ }
Expand description

Prepared, reusable, thread-safe forward planar capture plan.

Built via PlanarCapturePlan::build or PlanarCapturePlan::build_with_options, capturing the validated target PlanarCaptureSpec, compiled color/transfer RowPlan, exact f64 / rational i128 YCbCr/GBR forward matrix, and chroma downsampling geometry.

Implementations§

Source§

impl PlanarCapturePlan

Source

pub fn build( src: &PixelFormat, dst: PlanarCaptureSpec, policy: &ConvertPolicy, ) -> Result<Self, At<ConvertError>>

Compile a forward planar capture plan with default PlanarCaptureOptions::siting_aware() and no pre-resolved HDR peak.

Source

pub fn build_with_options( src: &PixelFormat, dst: PlanarCaptureSpec, policy: &ConvertPolicy, options: PlanarCaptureOptions, resolved_source_peak: Option<Nits>, ) -> Result<Self, At<ConvertError>>

Compile a forward planar capture plan with explicit PlanarCaptureOptions and optional resolved HDR source peak luminance (for HDR → SDR tone mapping).

Source

pub fn build_with_pulse( src: &PixelFormat, dst: PlanarCaptureSpec, policy: &ConvertPolicy, options: PlanarCaptureOptions, resolved_source_peak: Option<Nits>, pulse: Option<&dyn Pulse>, ) -> Result<Self, At<ConvertError>>

Compile a forward planar capture plan with explicit PlanarCaptureOptions, optional resolved HDR source peak luminance, and optional cooperative cancellation/progress via pulse (forwarded to any configured CmsBackend or ToneMapper; pass None when not needed).

Source

pub fn spec(&self) -> &PlanarCaptureSpec

Validated destination PlanarCaptureSpec.

Source

pub fn source_format(&self) -> &PixelFormat

Expected source PixelFormat.

Source

pub const fn options(&self) -> PlanarCaptureOptions

Source

pub const fn resolved_siting(&self) -> ChromaSiting

Effective ChromaSiting applied during capture (reflecting unknown_siting_fallback when spec.chroma_siting was ChromaSiting::Unknown).

Source

pub fn required_scratch_f64s(&self) -> usize

Number of f64 elements required in CaptureScratch for execute.

Source

pub fn required_scratch_bytes(&self) -> usize

Bytes required in CaptureScratch for execute.

Source

pub fn execute( &self, src: PixelView<'_>, dst: &mut PlanarViewMut<'_>, scratch: &mut CaptureScratch<'_>, ) -> Result<(), At<ConvertError>>

Execute the capture plan into a caller-provided strided PlanarViewMut using caller-owned CaptureScratch (zero heap allocation on native routes when scratch is pre-sized or borrowed via CaptureScratch::from_f64_slice).

For subsampled targets, dst.chroma_siting() must match resolved_siting so borrowed destinations never report an inconsistent or missing chroma siting.

Source

pub fn execute_with_pulse( &self, src: PixelView<'_>, dst: &mut PlanarViewMut<'_>, scratch: &mut CaptureScratch<'_>, pulse: Option<&dyn Pulse>, ) -> Result<(), At<ConvertError>>

Execute the capture plan with optional cooperative cancellation and row progress via pulse (pass None when not needed).

Source

pub fn capture_to_buf( &self, src: PixelView<'_>, scratch: &mut CaptureScratch<'_>, ) -> Result<PlanarBuf, At<ConvertError>>

Allocate a tagged PlanarBuf covering the zero-origin visible_rect (does not allocate extra coded_extent right/bottom padding; requires visible_rect.(x, y) == (0, 0)).

For non-zero crop origins or padded coded frames, construct a PlanarViewMut over your own backing planes and call execute.

Source

pub fn capture_to_buf_with_pulse( &self, src: PixelView<'_>, scratch: &mut CaptureScratch<'_>, pulse: Option<&dyn Pulse>, ) -> Result<PlanarBuf, At<ConvertError>>

Allocate a tagged PlanarBuf covering the zero-origin visible_rect with optional cooperative cancellation and row progress via pulse (pass None when not needed).

Trait Implementations§

Source§

impl Clone for PlanarCapturePlan

Source§

fn clone(&self) -> PlanarCapturePlan

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanarCapturePlan

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.