pub struct ConvertPlan { /* private fields */ }Expand description
Pre-computed conversion plan.
Stores the chain of steps needed to convert from one format to another. Created once, applied to every row.
Implementations§
Source§impl ConvertPlan
impl ConvertPlan
Sourcepub fn new(
from: PixelDescriptor,
to: PixelDescriptor,
) -> Result<Self, At<ConvertError>>
pub fn new( from: PixelDescriptor, to: PixelDescriptor, ) -> Result<Self, At<ConvertError>>
Create a conversion plan from from to to.
Returns Err if no conversion path exists.
Sourcepub fn new_explicit(
from: PixelDescriptor,
to: PixelDescriptor,
options: &ConvertOptions,
) -> Result<Self, At<ConvertError>>
pub fn new_explicit( from: PixelDescriptor, to: PixelDescriptor, options: &ConvertOptions, ) -> Result<Self, At<ConvertError>>
Create a conversion plan with explicit policy enforcement.
Validates that the planned conversion steps are allowed by the given policies before creating the plan. Returns an error if a forbidden operation would be required.
Sourcepub fn compose(&self, other: &Self) -> Option<Self>
pub fn compose(&self, other: &Self) -> Option<Self>
Compose two plans into one: apply self then other.
The composed plan executes both conversions in a single convert_row
call, using one intermediate buffer instead of two. Adjacent inverse
steps are cancelled (e.g., SrgbU8ToLinearF32 + LinearF32ToSrgbU8
→ identity).
Returns None if self.to != other.from (incompatible plans).
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
True if conversion is a no-op.
Sourcepub fn from(&self) -> PixelDescriptor
pub fn from(&self) -> PixelDescriptor
Source descriptor.
Sourcepub fn to(&self) -> PixelDescriptor
pub fn to(&self) -> PixelDescriptor
Target descriptor.
Trait Implementations§
Source§impl Clone for ConvertPlan
impl Clone for ConvertPlan
Source§fn clone(&self) -> ConvertPlan
fn clone(&self) -> ConvertPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more