Struct jxl_color::ColorTransform
source · pub struct ColorTransform { /* private fields */ }
Expand description
Color transformation from a color encoding to another.
Implementations§
source§impl ColorTransform
impl ColorTransform
sourcepub fn builder() -> ColorTransformBuilder
pub fn builder() -> ColorTransformBuilder
Creates a new ColorTransform
builder.
sourcepub fn new(
from: &ColorEncodingWithProfile,
to: &ColorEncodingWithProfile,
oim: &OpsinInverseMatrix,
tone_mapping: &ToneMapping
) -> Result<Self>
pub fn new( from: &ColorEncodingWithProfile, to: &ColorEncodingWithProfile, oim: &OpsinInverseMatrix, tone_mapping: &ToneMapping ) -> Result<Self>
Prepares a color transformation.
§Errors
This function will return an error if it cannot prepare such color transformation.
sourcepub fn xyb_to_enum(
xyb_rendering_intent: RenderingIntent,
encoding: &EnumColourEncoding,
oim: &OpsinInverseMatrix,
tone_mapping: &ToneMapping
) -> Result<Self>
pub fn xyb_to_enum( xyb_rendering_intent: RenderingIntent, encoding: &EnumColourEncoding, oim: &OpsinInverseMatrix, tone_mapping: &ToneMapping ) -> Result<Self>
Prepares a color transformation from XYB color encoding.
§Errors
This function will return an error if it cannot prepare such color transformation.
sourcepub fn run<Cms: ColorManagementSystem + ?Sized>(
&self,
channels: &mut [&mut [f32]],
cms: &Cms
) -> Result<usize>
pub fn run<Cms: ColorManagementSystem + ?Sized>( &self, channels: &mut [&mut [f32]], cms: &Cms ) -> Result<usize>
Performs the prepared color transformation on the samples.
Returns the number of final channels after transformation.
channels
are planar sample data, all having the same length.
§Errors
This function will return an error if it encountered ICC to ICC operation and the provided CMS cannot handle it.
sourcepub fn run_with_threads<Cms: ColorManagementSystem + Sync + ?Sized>(
&self,
channels: &mut [&mut [f32]],
cms: &Cms,
pool: &JxlThreadPool
) -> Result<usize>
pub fn run_with_threads<Cms: ColorManagementSystem + Sync + ?Sized>( &self, channels: &mut [&mut [f32]], cms: &Cms, pool: &JxlThreadPool ) -> Result<usize>
Performs the prepared color transformation on the samples with the thread pool.
Returns the number of final channels after transformation.
channels
are planar sample data, all having the same length.
§Errors
This function will return an error if it encountered ICC to ICC operation and the provided CMS cannot handle it.
Trait Implementations§
source§impl Clone for ColorTransform
impl Clone for ColorTransform
source§fn clone(&self) -> ColorTransform
fn clone(&self) -> ColorTransform
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more