pub struct ColorSpaceSet { /* private fields */ }Expand description
Mutable collection of ColorSpace handles used by OCIO set-style APIs.
Implementations§
Source§impl ColorSpaceSet
impl ColorSpaceSet
Sourcepub fn try_color_space_index(&self, name: impl AsRef<str>) -> Result<i32>
pub fn try_color_space_index(&self, name: impl AsRef<str>) -> Result<i32>
Look up a name with OCIO’s matching rules; -1 means absent.
Sourcepub fn try_has_color_space(&self, name: impl AsRef<str>) -> Result<bool>
pub fn try_has_color_space(&self, name: impl AsRef<str>) -> Result<bool>
Check name or alias membership, preserving native errors.
Sourcepub fn try_equals<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<bool>
pub fn try_equals<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<bool>
Compare the sets by color-space names, as OCIO does.
Sourcepub fn union<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<ConstColorSpaceSet>
pub fn union<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>
Return OCIO’s union as an independently owned read-only set.
Sourcepub fn intersection<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<ConstColorSpaceSet>
pub fn intersection<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>
Return OCIO’s intersection as an independently owned read-only set.
Sourcepub fn difference<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<ConstColorSpaceSet>
pub fn difference<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>
Return OCIO’s difference as an independently owned read-only set.
Sourcepub fn create_editable_copy(&self) -> Result<Self>
pub fn create_editable_copy(&self) -> Result<Self>
Create an editable copy that is independent from the original set.
Sourcepub fn num_color_spaces(&self) -> i32
pub fn num_color_spaces(&self) -> i32
Return the number of color spaces currently in the set.
Sourcepub fn color_space_name_by_index(&self, index: i32) -> Option<String>
pub fn color_space_name_by_index(&self, index: i32) -> Option<String>
Return one color-space name by index.
Sourcepub fn try_color_space_name_by_index(
&self,
index: i32,
) -> Result<Option<String>>
pub fn try_color_space_name_by_index( &self, index: i32, ) -> Result<Option<String>>
Return a color-space name by index while preserving bridge failures.
Sourcepub fn color_space_by_index(&self, index: i32) -> Option<ColorSpace>
pub fn color_space_by_index(&self, index: i32) -> Option<ColorSpace>
Return an independent editable copy of a color space by index.
Sourcepub fn try_color_space_by_index(&self, index: i32) -> Result<Option<ColorSpace>>
pub fn try_color_space_by_index(&self, index: i32) -> Result<Option<ColorSpace>>
Copy a color space by index while preserving bridge failures.
Sourcepub fn color_space(&self, name: impl AsRef<str>) -> Option<ColorSpace>
pub fn color_space(&self, name: impl AsRef<str>) -> Option<ColorSpace>
Look up an independent editable color-space copy by name.
Sourcepub fn try_const_color_space(
&self,
name: impl AsRef<str>,
) -> Result<Option<ConstColorSpace>>
pub fn try_const_color_space( &self, name: impl AsRef<str>, ) -> Result<Option<ConstColorSpace>>
Look up a shared read-only color space without copying the native object.
Sourcepub fn try_const_color_space_by_index(
&self,
index: i32,
) -> Result<Option<ConstColorSpace>>
pub fn try_const_color_space_by_index( &self, index: i32, ) -> Result<Option<ConstColorSpace>>
Share a native color space by index, or return None for an invalid index.
The returned handle remains valid if the set is modified or dropped.
Sourcepub fn try_color_space(
&self,
name: impl AsRef<str>,
) -> Result<Option<ColorSpace>>
pub fn try_color_space( &self, name: impl AsRef<str>, ) -> Result<Option<ColorSpace>>
Copy a color space by name while preserving bridge failures.
Sourcepub fn color_space_index(&self, name: impl AsRef<str>) -> i32
pub fn color_space_index(&self, name: impl AsRef<str>) -> i32
Return the index of a color space by name, or -1 when missing.
Sourcepub fn has_color_space(&self, name: impl AsRef<str>) -> bool
pub fn has_color_space(&self, name: impl AsRef<str>) -> bool
Return whether a color space named name is present in the set.
Sourcepub fn add_color_space(&self, color_space: &ColorSpace)
pub fn add_color_space(&self, color_space: &ColorSpace)
Insert one color space into the set.
Sourcepub fn try_add_color_space(&self, color_space: &ColorSpace) -> Result<()>
pub fn try_add_color_space(&self, color_space: &ColorSpace) -> Result<()>
Insert one color space into the set and surface any OCIO validation error.
Sourcepub fn try_add_color_space_ref<'a>(
&self,
color_space: impl Into<ColorSpaceRef<'a>>,
) -> Result<()>
pub fn try_add_color_space_ref<'a>( &self, color_space: impl Into<ColorSpaceRef<'a>>, ) -> Result<()>
Add an editable or read-only color space. OCIO stores an independent copy.
Sourcepub fn add_color_spaces(&self, other: &ColorSpaceSet)
pub fn add_color_spaces(&self, other: &ColorSpaceSet)
Insert every color space from other into the set.
Sourcepub fn try_add_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>
pub fn try_add_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>
Insert every color space from other and surface any OCIO validation error.
Sourcepub fn try_add_color_spaces_ref<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<()>
pub fn try_add_color_spaces_ref<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<()>
Add copies of the color spaces in an editable or read-only set. As in OCIO, a conflict can leave preceding entries already added.
Sourcepub fn remove_color_space(&self, name: impl AsRef<str>) -> Result<()>
pub fn remove_color_space(&self, name: impl AsRef<str>) -> Result<()>
Remove one color space by canonical name, case-insensitively.
Unlike lookup and membership queries, OCIO does not resolve aliases when removing; an alias or other missing name leaves the set unchanged.
Sourcepub fn remove_color_spaces(&self, other: &ColorSpaceSet)
pub fn remove_color_spaces(&self, other: &ColorSpaceSet)
Remove every color space found in other from this set.
Sourcepub fn try_remove_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>
pub fn try_remove_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>
Remove every color space found in other and surface any OCIO validation error.
Sourcepub fn try_remove_color_spaces_ref<'a>(
&self,
other: impl Into<ColorSpaceSetRef<'a>>,
) -> Result<()>
pub fn try_remove_color_spaces_ref<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<()>
Remove entries named by an editable or read-only set. Removing this set from itself clears it safely.
Sourcepub fn clear_color_spaces(&self)
pub fn clear_color_spaces(&self)
Remove every color space from the set.
Sourcepub fn try_clear_color_spaces(&self) -> Result<()>
pub fn try_clear_color_spaces(&self) -> Result<()>
Remove every color space and surface any OCIO validation error.