pub trait Transform<Src, Ctx: ?Sized = ()>: Sized + 'static {
// Required method
fn transform_from(src: Src, ctx: &Ctx) -> Self;
}Expand description
Produce Self from a source color Src infallibly.
Implement for transforms that cannot clip: RGB to XYZ, layout reorders,
and transforms between spaces whose gamuts are compatible.
A blanket impl provides TryTransform for free.
Ctx defaults to () for static transforms:
| Transform | Ctx |
|---|---|
| sRGB to XYZ | () |
| Device CMYK to XYZ | IccProfile |
| XYZ to CAM16-UCS | ViewingConditions |
| Relative XYZ to Absolute XYZ | f32 (cd/m2) |
Required Methods§
Sourcefn transform_from(src: Src, ctx: &Ctx) -> Self
fn transform_from(src: Src, ctx: &Ctx) -> Self
Perform the transform.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.