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.
pub fn is_noop(&self) -> bool
pub fn input_channels(&self) -> usize
pub fn output_channels(&self) -> usize
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 moreAuto Trait Implementations§
impl Freeze for ColorTransform
impl RefUnwindSafe for ColorTransform
impl Send for ColorTransform
impl Sync for ColorTransform
impl Unpin for ColorTransform
impl UnwindSafe for ColorTransform
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)