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
)