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
impl PlanarCapturePlan
Sourcepub fn build(
src: &PixelFormat,
dst: PlanarCaptureSpec,
policy: &ConvertPolicy,
) -> Result<Self, At<ConvertError>>
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.
Sourcepub fn build_with_options(
src: &PixelFormat,
dst: PlanarCaptureSpec,
policy: &ConvertPolicy,
options: PlanarCaptureOptions,
resolved_source_peak: Option<Nits>,
) -> Result<Self, At<ConvertError>>
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).
Sourcepub 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>>
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).
Sourcepub fn spec(&self) -> &PlanarCaptureSpec
pub fn spec(&self) -> &PlanarCaptureSpec
Validated destination PlanarCaptureSpec.
Sourcepub fn source_format(&self) -> &PixelFormat
pub fn source_format(&self) -> &PixelFormat
Expected source PixelFormat.
Sourcepub const fn options(&self) -> PlanarCaptureOptions
pub const fn options(&self) -> PlanarCaptureOptions
Active PlanarCaptureOptions.
Sourcepub const fn resolved_siting(&self) -> ChromaSiting
pub const fn resolved_siting(&self) -> ChromaSiting
Effective ChromaSiting applied during capture (reflecting unknown_siting_fallback
when spec.chroma_siting was ChromaSiting::Unknown).
Sourcepub fn required_scratch_f64s(&self) -> usize
pub fn required_scratch_f64s(&self) -> usize
Number of f64 elements required in CaptureScratch for execute.
Sourcepub fn required_scratch_bytes(&self) -> usize
pub fn required_scratch_bytes(&self) -> usize
Bytes required in CaptureScratch for execute.
Sourcepub fn execute(
&self,
src: PixelView<'_>,
dst: &mut PlanarViewMut<'_>,
scratch: &mut CaptureScratch<'_>,
) -> Result<(), At<ConvertError>>
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.
Sourcepub fn execute_with_pulse(
&self,
src: PixelView<'_>,
dst: &mut PlanarViewMut<'_>,
scratch: &mut CaptureScratch<'_>,
pulse: Option<&dyn Pulse>,
) -> Result<(), At<ConvertError>>
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).
Sourcepub fn capture_to_buf(
&self,
src: PixelView<'_>,
scratch: &mut CaptureScratch<'_>,
) -> Result<PlanarBuf, At<ConvertError>>
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.
Sourcepub fn capture_to_buf_with_pulse(
&self,
src: PixelView<'_>,
scratch: &mut CaptureScratch<'_>,
pulse: Option<&dyn Pulse>,
) -> Result<PlanarBuf, At<ConvertError>>
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
impl Clone for PlanarCapturePlan
Source§fn clone(&self) -> PlanarCapturePlan
fn clone(&self) -> PlanarCapturePlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more