Skip to main content

ColorSpaceSet

Struct ColorSpaceSet 

Source
pub struct ColorSpaceSet { /* private fields */ }
Expand description

Mutable collection of ColorSpace handles used by OCIO set-style APIs.

Implementations§

Source§

impl ColorSpaceSet

Source

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.

Source

pub fn try_has_color_space(&self, name: impl AsRef<str>) -> Result<bool>

Check name or alias membership, preserving native errors.

Source

pub fn try_equals<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<bool>

Compare the sets by color-space names, as OCIO does.

Source

pub fn union<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>

Return OCIO’s union as an independently owned read-only set.

Source

pub fn intersection<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>

Return OCIO’s intersection as an independently owned read-only set.

Source

pub fn difference<'a>( &self, other: impl Into<ColorSpaceSetRef<'a>>, ) -> Result<ConstColorSpaceSet>

Return OCIO’s difference as an independently owned read-only set.

Source

pub fn create() -> Result<Self>

Create an empty color-space set.

Source

pub fn create_editable_copy(&self) -> Result<Self>

Create an editable copy that is independent from the original set.

Source

pub fn num_color_spaces(&self) -> i32

Return the number of color spaces currently in the set.

Source

pub fn color_space_name_by_index(&self, index: i32) -> Option<String>

Return one color-space name by index.

Source

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.

Source

pub fn color_space_by_index(&self, index: i32) -> Option<ColorSpace>

Return an independent editable copy of a color space by index.

Source

pub fn try_color_space_by_index(&self, index: i32) -> Result<Option<ColorSpace>>

Copy a color space by index while preserving bridge failures.

Source

pub fn color_space(&self, name: impl AsRef<str>) -> Option<ColorSpace>

Look up an independent editable color-space copy by name.

Source

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.

Source

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.

Source

pub fn try_color_space( &self, name: impl AsRef<str>, ) -> Result<Option<ColorSpace>>

Copy a color space by name while preserving bridge failures.

Source

pub fn color_space_index(&self, name: impl AsRef<str>) -> i32

Return the index of a color space by name, or -1 when missing.

Source

pub fn has_color_space(&self, name: impl AsRef<str>) -> bool

Return whether a color space named name is present in the set.

Source

pub fn add_color_space(&self, color_space: &ColorSpace)

Insert one color space into the set.

Source

pub fn try_add_color_space(&self, color_space: &ColorSpace) -> Result<()>

Insert one color space into the set and surface any OCIO validation error.

Source

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.

Source

pub fn add_color_spaces(&self, other: &ColorSpaceSet)

Insert every color space from other into the set.

Source

pub fn try_add_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>

Insert every color space from other and surface any OCIO validation error.

Source

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.

Source

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.

Source

pub fn remove_color_spaces(&self, other: &ColorSpaceSet)

Remove every color space found in other from this set.

Source

pub fn try_remove_color_spaces(&self, other: &ColorSpaceSet) -> Result<()>

Remove every color space found in other and surface any OCIO validation error.

Source

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.

Source

pub fn clear_color_spaces(&self)

Remove every color space from the set.

Source

pub fn try_clear_color_spaces(&self) -> Result<()>

Remove every color space and surface any OCIO validation error.

Trait Implementations§

Source§

impl Drop for ColorSpaceSet

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a> From<&'a ColorSpaceSet> for ColorSpaceSetRef<'a>

Source§

fn from(value: &'a ColorSpaceSet) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.