pub struct OutputPlan { /* private fields */ }Expand description
Atomic encoder preparation plan combining ImagePlan with OutputSignaling.
Implementations§
Source§impl OutputPlan
impl OutputPlan
Sourcepub fn build(
src: impl AsRef<PixelFormat>,
dst: impl AsRef<PixelFormat>,
policy: &ConvertPolicy,
peak: PeakSource,
signaling: OutputSignaling,
) -> Result<Self, At<ConvertError>>
pub fn build( src: impl AsRef<PixelFormat>, dst: impl AsRef<PixelFormat>, policy: &ConvertPolicy, peak: PeakSource, signaling: OutputSignaling, ) -> Result<Self, At<ConvertError>>
Build an encode-ready output plan.
Accepts either borrowed &PixelFormat or owned PixelFormat at the call site and borrows
&ConvertPolicy (retaining internal clones inside the built plan).
Validates pixel conversion feasibility AND container signaling compatibility
upfront (for non-origin-dependent signaling modes) so invalid output configurations
fail before processing any pixels. Note that signaling rules inspect the
destination spec (dst) — for example, OutputSignaling::CicpOnly and
OutputSignaling::Auto refuse Transfer::Hlg(HlgMode::Display(_)) when dst
targets display-referred HLG (converting from display HLG to sRGB or PQ
succeeds because the output signaling is sRGB or PQ).
Sourcepub fn build_with_pulse(
src: impl AsRef<PixelFormat>,
dst: impl AsRef<PixelFormat>,
policy: &ConvertPolicy,
peak: PeakSource,
signaling: OutputSignaling,
pulse: Option<&dyn Pulse>,
) -> Result<Self, At<ConvertError>>
pub fn build_with_pulse( src: impl AsRef<PixelFormat>, dst: impl AsRef<PixelFormat>, policy: &ConvertPolicy, peak: PeakSource, signaling: OutputSignaling, pulse: Option<&dyn Pulse>, ) -> Result<Self, At<ConvertError>>
Build an encode-ready output plan with optional cooperative cancellation and progress
via pulse (forwarded to any configured CmsBackend or
ToneMapper; pass None when not needed).
Sourcepub const fn is_identity(&self) -> bool
pub const fn is_identity(&self) -> bool
Whether pixel bytes require no conversion under the plan’s policy (src == dst,
excluding unverified AlphaMode::Opaque buffers that need alpha canonicalization).
Note: even when is_identity() is false due to an unverified Opaque alpha slot,
execute_view and execute_buf still take
the zero-copy path when the runtime input carries facts().all_opaque == true.
Sourcepub fn execute_view<'a>(
&self,
view: PixelView<'a>,
origin: &ColorOrigin,
) -> Result<EncodeReady<'a>, At<ConvertError>>
pub fn execute_view<'a>( &self, view: PixelView<'a>, origin: &ColorOrigin, ) -> Result<EncodeReady<'a>, At<ConvertError>>
Execute on a borrowed PixelView<'a>, returning zero-copy PixelCow::Borrowed on identity.
Sourcepub fn execute_view_with_pulse<'a>(
&self,
view: PixelView<'a>,
origin: &ColorOrigin,
pulse: Option<&dyn Pulse>,
) -> Result<EncodeReady<'a>, At<ConvertError>>
pub fn execute_view_with_pulse<'a>( &self, view: PixelView<'a>, origin: &ColorOrigin, pulse: Option<&dyn Pulse>, ) -> Result<EncodeReady<'a>, At<ConvertError>>
Execute on a borrowed PixelView<'a> with optional cooperative cancellation and
progress via pulse (pass None when not needed).
Sourcepub fn execute_buf(
&self,
buf: PixelBuf,
) -> Result<EncodeReady<'static>, At<ConvertError>>
pub fn execute_buf( &self, buf: PixelBuf, ) -> Result<EncodeReady<'static>, At<ConvertError>>
Execute on an owned PixelBuf, moving buf zero-copy on identity!
Sourcepub fn execute_buf_with_pulse(
&self,
buf: PixelBuf,
pulse: Option<&dyn Pulse>,
) -> Result<EncodeReady<'static>, At<ConvertError>>
pub fn execute_buf_with_pulse( &self, buf: PixelBuf, pulse: Option<&dyn Pulse>, ) -> Result<EncodeReady<'static>, At<ConvertError>>
Execute on an owned PixelBuf with optional cooperative cancellation and progress via
pulse (pass None when not needed).
Sourcepub fn source_format(&self) -> &PixelFormat
pub fn source_format(&self) -> &PixelFormat
Source spec.
Sourcepub fn destination_format(&self) -> &PixelFormat
pub fn destination_format(&self) -> &PixelFormat
Destination spec.
Sourcepub fn resolve_signaling(
&self,
origin: &ColorOrigin,
) -> Result<ResolvedSignaling, At<ConvertError>>
pub fn resolve_signaling( &self, origin: &ColorOrigin, ) -> Result<ResolvedSignaling, At<ConvertError>>
Resolve and validate container color signaling (cicp and icc) upfront before
streaming rows into an encoder (avoids materializing a full EncodeReady buffer).
Sourcepub fn build_row_plan(
&self,
resolved_source_peak: Option<Nits>,
) -> Result<RowPlan, At<ConvertError>>
pub fn build_row_plan( &self, resolved_source_peak: Option<Nits>, ) -> Result<RowPlan, At<ConvertError>>
Build a streaming RowPlan matching this output plan so
row encoders can emit validated headers via resolve_signaling
and convert scanlines without full-frame allocation.
Sourcepub fn build_row_plan_with_pulse(
&self,
resolved_source_peak: Option<Nits>,
pulse: Option<&dyn Pulse>,
) -> Result<RowPlan, At<ConvertError>>
pub fn build_row_plan_with_pulse( &self, resolved_source_peak: Option<Nits>, pulse: Option<&dyn Pulse>, ) -> Result<RowPlan, At<ConvertError>>
Build a streaming RowPlan matching this output plan with optional
cooperative cancellation and progress via pulse (pass None when not needed).
Sourcepub fn adapt_for_encode<'a>(
src: PixelView<'a>,
origin: &ColorOrigin,
supported: &[PixelFormat],
policy: &ConvertPolicy,
peak: PeakSource,
signaling: OutputSignaling,
) -> Result<(NegotiatedFormat, EncodeReady<'a>), At<ConvertError>>
pub fn adapt_for_encode<'a>( src: PixelView<'a>, origin: &ColorOrigin, supported: &[PixelFormat], policy: &ConvertPolicy, peak: PeakSource, signaling: OutputSignaling, ) -> Result<(NegotiatedFormat, EncodeReady<'a>), At<ConvertError>>
One-shot encoder preparation: negotiate the lowest-loss, lowest-effort format from
supported under policy, convert (or borrow zero-copy on identity), and resolve
guaranteed-matching container color signaling (cicp, icc, hdr).
Thin wrapper combining Negotiate::select,
OutputPlan::build, and OutputPlan::execute_view, automatically merging
src.attached_claims() into policy.source_claims before negotiation. Returns
ConvertError::UnsupportedRoute if no candidate in supported satisfies policy.
Sourcepub fn adapt_for_encode_with_pulse<'a>(
src: PixelView<'a>,
origin: &ColorOrigin,
supported: &[PixelFormat],
policy: &ConvertPolicy,
peak: PeakSource,
signaling: OutputSignaling,
pulse: Option<&dyn Pulse>,
) -> Result<(NegotiatedFormat, EncodeReady<'a>), At<ConvertError>>
pub fn adapt_for_encode_with_pulse<'a>( src: PixelView<'a>, origin: &ColorOrigin, supported: &[PixelFormat], policy: &ConvertPolicy, peak: PeakSource, signaling: OutputSignaling, pulse: Option<&dyn Pulse>, ) -> Result<(NegotiatedFormat, EncodeReady<'a>), At<ConvertError>>
One-shot encoder preparation with optional cooperative cancellation and progress via
pulse (pass None when not needed).
Trait Implementations§
Source§impl Clone for OutputPlan
impl Clone for OutputPlan
Source§fn clone(&self) -> OutputPlan
fn clone(&self) -> OutputPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more