Struct lcms2::ThreadContext
[−]
[src]
pub struct ThreadContext { /* fields omitted */ }
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 Send for ThreadContext
[src]
impl Clone for ThreadContext
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more