pub struct RowPlan { /* private fields */ }Expand description
Compiled, reusable, thread-safe single-row pixel converter.
Built via RowPlan::build with an explicit optional hdr_peak: Option<Nits>.
Calling convert_row on native routes allocates zero
heap memory and uses a 1 KiB stack-allocated 64-pixel SoA tile.
Implementations§
Source§impl RowPlan
impl RowPlan
Sourcepub fn build(
src: impl AsRef<PixelFormat>,
dst: impl AsRef<PixelFormat>,
policy: &ConvertPolicy,
resolved_source_peak: Option<Nits>,
) -> Result<Self, At<ConvertError>>
pub fn build( src: impl AsRef<PixelFormat>, dst: impl AsRef<PixelFormat>, policy: &ConvertPolicy, resolved_source_peak: Option<Nits>, ) -> Result<Self, At<ConvertError>>
Compile a single-row conversion plan from src to dst under policy.
Accepts either borrowed &PixelFormat or owned PixelFormat at the call site (retaining
internal clones inside the compiled plan).
For HDR → SDR tone mapping with a pipeline-managed mapper, pass
resolved_source_peak: Some(nits) (None means no peak supplied — never “measure this
row”). To measure peak automatically over a whole image, use ImagePlan::build with
PeakSource::Measured.
Sourcepub fn build_with_pulse(
src: impl AsRef<PixelFormat>,
dst: impl AsRef<PixelFormat>,
policy: &ConvertPolicy,
resolved_source_peak: Option<Nits>,
pulse: Option<&dyn Pulse>,
) -> Result<Self, At<ConvertError>>
pub fn build_with_pulse( src: impl AsRef<PixelFormat>, dst: impl AsRef<PixelFormat>, policy: &ConvertPolicy, resolved_source_peak: Option<Nits>, pulse: Option<&dyn Pulse>, ) -> Result<Self, At<ConvertError>>
Build a compiled RowPlan with optional cooperative cancellation and progress via
pulse (forwarded to CmsBackend::build_transform
and ToneMapper::prepare; pass None when not needed).
Sourcepub fn source_format(&self) -> &PixelFormat
pub fn source_format(&self) -> &PixelFormat
Source image specification.
Sourcepub fn destination_format(&self) -> &PixelFormat
pub fn destination_format(&self) -> &PixelFormat
Destination image specification.
Sourcepub const fn output_claims(&self) -> SampleClaims
pub const fn output_claims(&self) -> SampleClaims
Proven SampleClaims guaranteed on pixels emitted by this plan.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Whether this plan executes as a direct byte-copy (Memcpy) route with no per-sample work.
Includes identical src == dst (unless unverified AlphaMode::Opaque requires alpha
canonicalization) as well as same-layout proven-opaque Straight <-> Premultiplied or
same-layout metadata relabels that need no pixel transformation.
Sourcepub fn convert_row(
&self,
src_row: &[u8],
dst_row: &mut [u8],
width_pixels: u32,
) -> Result<(), At<ConvertError>>
pub fn convert_row( &self, src_row: &[u8], dst_row: &mut [u8], width_pixels: u32, ) -> Result<(), At<ConvertError>>
Convert a single row of width_pixels pixels from src_row into dst_row with
zero heap allocation.
Uses row index 0 for ordered dithering. When converting a multi-row image with
DepthPolicy::OrderedDither, use convert_row_at to pass
the vertical row coordinate so the 2D Bayer 4×4 matrix varies across rows.
Sourcepub fn convert_row_at(
&self,
row_index: u32,
src_row: &[u8],
dst_row: &mut [u8],
width_pixels: u32,
) -> Result<(), At<ConvertError>>
pub fn convert_row_at( &self, row_index: u32, src_row: &[u8], dst_row: &mut [u8], width_pixels: u32, ) -> Result<(), At<ConvertError>>
Convert a single row of width_pixels pixels at vertical coordinate row_index from
src_row into dst_row with zero heap allocation.
row_index selects the vertical phase of the 2D Bayer 4×4 matrix under
DepthPolicy::OrderedDither so strips and bands produce identical dither patterns
to whole-image conversion.