[−][src]Struct lcms2::ThreadContext
Per-thread context for multi-threaded operation.
There are situations where several instances of Little CMS engine have to coexist but on different conditions. For example, when the library is used as a DLL or a shared object, diverse applications may want to use different plug-ins. Another example is when multiple threads are being used in same task and the user wants to pass thread-dependent information to the memory allocators or the logging system. The context is a pointer to an internal structure that keeps track of all plug-ins and static data needed by the THR corresponding function.
A context-aware app could allocate a new context by calling new() or duplicate a yet-existing one by using clone(). Each context can hold different plug-ins, defined by the Plugin parameter. The context can also hold loggers.
Users may associate private data across a void pointer when creating the context, and can retrieve this pointer later.
When you see an error "expected reference, found struct lcms2::GlobalContext
", it means you've mixed global and thread-context objects. They don't work together.
For example, if you create a Transform
with a context (calling new_*_context()
), then it will only support Profile
with a context as well.
Methods
impl ThreadContext
[src]
pub fn new() -> Self
[src]
pub fn user_data(&self) -> *mut c_void
[src]
pub unsafe fn install_plugin(&mut self, plugin: *mut c_void) -> bool
[src]
pub fn unregister_plugins(&mut self)
[src]
pub fn supported_intents(&self) -> HashMap<Intent, &CStr>
[src]
pub fn adaptation_state(&self) -> f64
[src]
Adaptation state for absolute colorimetric intent, on all but cmsCreateExtendedTransform.
pub fn set_adaptation_state(&mut self, value: f64)
[src]
Sets adaptation state for absolute colorimetric intent in the given context. Adaptation state applies on all but cmsCreateExtendedTransformTHR(). Little CMS can handle incomplete adaptation states.
Degree on adaptation 0=Not adapted, 1=Complete adaptation, in-between=Partial adaptation.
pub fn set_alarm_codes(&mut self, codes: [u16; 16])
[src]
Sets the codes used to mark out-out-gamut on Proofing transforms for a given context. Values are meant to be encoded in 16 bits.
AlarmCodes: Array [16] of codes. ALL 16 VALUES MUST BE SPECIFIED, set to zero unused channels.
pub fn alarm_codes(&self) -> [u16; 16]
[src]
Gets the current codes used to mark out-out-gamut on Proofing transforms for the given context. Values are meant to be encoded in 16 bits.
Trait Implementations
impl Drop for ThreadContext
[src]
impl Default for ThreadContext
[src]
impl Clone for ThreadContext
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Send for ThreadContext
[src]
Auto Trait Implementations
impl !Sync for ThreadContext
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,