Skip to main content

CmsBackend

Trait CmsBackend 

Source
pub trait CmsBackend:
    Send
    + Sync
    + Debug {
    // Required method
    fn build_transform(
        &self,
        src: &PixelFormat,
        dst: &PixelFormat,
        pulse: Option<&dyn Pulse>,
    ) -> Result<Arc<dyn CmsTransform>, At<ConvertError>>;

    // Provided method
    fn supports_formats(&self, _src: &PixelFormat, _dst: &PixelFormat) -> bool { ... }
}
Expand description

Pluggable ICC / CMYK Color Management System backend.

Required Methods§

Source

fn build_transform( &self, src: &PixelFormat, dst: &PixelFormat, pulse: Option<&dyn Pulse>, ) -> Result<Arc<dyn CmsTransform>, At<ConvertError>>

Build a row transform from src to dst, observing optional cooperative cancellation and progress via pulse.

Pass None when cancellation and progress reporting are not needed, or Some(pulse) (e.g. Some(&StopOnly::borrowed(stop)) for cancellation alone). Backends that parse ICC profiles or construct 3D CLUT / MPE transforms should call pulse.check() before and during expensive setup work and map StopReason into ConvertError::Cancelled. Per how-far’s contract, implementations borrow pulse and never finish it.

Provided Methods§

Source

fn supports_formats(&self, _src: &PixelFormat, _dst: &PixelFormat) -> bool

Fast, allocation-free check whether this backend supports the (src, dst) layouts, sample types, and color families (used by Negotiate to avoid selecting unbuildable candidates).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§