Skip to main content

RowTransform

Trait RowTransform 

Source
pub trait RowTransform: Send + Sync {
    // Required method
    fn transform_row(&self, src: &[u8], dst: &mut [u8], width: u32);
}
Expand description

Shareable, stateless row-level color transform.

Takes &self — the same instance can be held behind Arc<dyn RowTransform> and reused across threads, converters, or cached for batch workloads. Appropriate when the transform carries no per-call mutable state: pure matrix/LUT math, moxcms TransformExecutor (whose transform(&self, ...) is already &self), or any stateless formula-based conversion.

When the transform needs scratch buffers or per-call state, use RowTransformMut instead.

Required Methods§

Source

fn transform_row(&self, src: &[u8], dst: &mut [u8], width: u32)

Transform one row of pixels from source to destination color space.

src and dst may be different lengths if the transform changes the pixel format (e.g., CMYK to RGB). width is the number of pixels, not bytes.

Implementors§