#[non_exhaustive]pub struct ColorServices {
pub cms: CmsChoice,
pub tone_mapper: Option<Arc<dyn ToneMapper>>,
}Expand description
Shared color-management and tone-mapping service bundle.
Hosts configure a default ColorServices once, resolve per-run overrides via
resolve_against or freeze_or_strict,
and stamp the frozen services onto ConvertPolicy::with_color_services.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cms: CmsChoiceCMS provider choice (Inherit, StrictNoIcc, or Use(CmsBinding)).
tone_mapper: Option<Arc<dyn ToneMapper>>Optional custom HDR → SDR tone mapper shared across conversions.
Implementations§
Source§impl ColorServices
impl ColorServices
Sourcepub fn strict_no_icc() -> Self
pub fn strict_no_icc() -> Self
Forbid ICC CMS evaluation and inferred ICC substitution while permitting validated profile carriage and known-space math.
Sourcepub fn with_cms_binding(binding: CmsBinding) -> Self
pub fn with_cms_binding(binding: CmsBinding) -> Self
Create a service bundle bound to a specific CmsBinding.
Sourcepub fn with_tone_mapper(self, mapper: Arc<dyn ToneMapper>) -> Self
pub fn with_tone_mapper(self, mapper: Arc<dyn ToneMapper>) -> Self
Attach a custom ToneMapper.
Sourcepub const fn is_frozen(&self) -> bool
pub const fn is_frozen(&self) -> bool
Returns true when cms is no longer CmsChoice::Inherit.
Sourcepub const fn cms_choice(&self) -> &CmsChoice
pub const fn cms_choice(&self) -> &CmsChoice
Borrow the active CmsChoice.
Sourcepub fn cms_binding(&self) -> Option<&CmsBinding>
pub fn cms_binding(&self) -> Option<&CmsBinding>
Borrow the selected CmsBinding, if CmsChoice::Use.
Sourcepub fn tone_mapper(&self) -> Option<&Arc<dyn ToneMapper>>
pub fn tone_mapper(&self) -> Option<&Arc<dyn ToneMapper>>
Borrow the configured ToneMapper, if any.
Sourcepub fn resolve_against(&self, parent: &Self) -> Self
pub fn resolve_against(&self, parent: &Self) -> Self
Resolve CmsChoice::Inherit and missing tone_mapper against parent.
Explicit CmsChoice::StrictNoIcc and CmsChoice::Use choices on self
override parent.
Sourcepub fn freeze_or_strict(&self, default_cms: Option<&CmsBinding>) -> Self
pub fn freeze_or_strict(&self, default_cms: Option<&CmsBinding>) -> Self
Freeze inheritance for a run: CmsChoice::Inherit resolves to Use(default_cms)
if provided, or CmsChoice::StrictNoIcc if None.
Trait Implementations§
Source§impl Clone for ColorServices
impl Clone for ColorServices
Source§fn clone(&self) -> ColorServices
fn clone(&self) -> ColorServices
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more