Skip to main content

GroupTransform

Struct GroupTransform 

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

An ordered list of transforms evaluated as one transform.

Group transforms are useful for composing generated or user-authored transform chains before asking a Config for a processor. Adding or replacing a child rejects direct and indirect cycles before mutation. Acyclic groups may share children; non-group children require no graph traversal. Group traversal occurs only while editing, not per pixel.

Implementations§

Source§

impl GroupTransform

Source

pub fn create() -> Result<Self>

Create an empty group transform.

Source

pub fn num_transforms(&self) -> i32

Return the number of child transforms in the group.

Source

pub fn append_transform(&self, child: &impl TransformHandle) -> Result<()>

Append child to the end of the group.

Source

pub fn prepend_transform(&self, child: &impl TransformHandle) -> Result<()>

Insert child at the beginning of the group.

Source

pub fn transform(&self, index: i32) -> Option<Transform>

Return the child transform at index, if present.

The returned handle shares the native child rather than copying it. Mutating it affects every group retaining that child. Replacing the group’s slot does not retarget an already returned handle.

Source

pub fn try_transform(&self, index: i32) -> Result<Option<Transform>>

Return the shared native child while preserving OCIO query failures.

This has the same sharing and mutation semantics as Self::transform; it does not copy the child transform.

Source

pub fn set_transform( &self, index: i32, child: &impl TransformHandle, ) -> Result<()>

Replace a child in place, preserving the group’s identity and metadata.

The group retains the same native transform as child. Existing handles to the previous child remain valid. An invalid index returns an error.

Source

pub fn get_transform(&self, index: i32) -> Option<Transform>

👎Deprecated since 0.2.0:

compat alias; prefer transform()

Source

pub fn get_transform_v1(&self, index: i32) -> Option<Transform>

👎Deprecated since 0.2.0:

compat alias; prefer transform()

Source

pub fn direction(&self) -> TransformDirection

Return the transform direction used when this group is evaluated.

Source

pub fn set_direction(&self, direction: TransformDirection)

Set the transform direction used when this group is evaluated.

Source

pub fn try_set_direction(&self, direction: TransformDirection) -> Result<()>

Set the transform direction and surface any OCIO validation error.

Source

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

Copy the group container and metadata using OCIO’s native operation. Child transforms remain shared with the original. Use Self::create_deep_copy to independently copy the graph.

Source

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

Deep-copy the built-in transform graph while preserving sharing within the copy. Group nodes are reconstructed as native OCIO groups; other nodes use their native editable-copy method. Custom native subclasses may have additional state or copy semantics not represented by this API. Cycles and null children from external native interop are rejected.

Source

pub fn remove_transform(&self, index: usize) -> Result<()>

Remove the child transform at index by rebuilding this wrapper’s group.

OCIO exposes no in-place removal API. Existing shared references, including groups that already contain this group and previously obtained metadata, continue to refer to the original native object.

Source

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

Remove every child by rebuilding this wrapper’s group. Existing shared native references continue to point to the original group; see Self::remove_transform.

Source

pub unsafe fn write( &self, config: *mut c_void, format_name: *const i8, os: *mut c_void, )

👎Deprecated since 0.2.0:

raw OCIO ostream entry point; prefer write_to_string(&Config, format_name) for Rust callers

§Safety

config, format_name, and os must be valid pointers accepted by the OCIO ABI.

Source

pub fn write_to_string( &self, config: &Config, format_name: impl AsRef<str>, ) -> Result<Option<String>>

Serialize this group transform using OCIO’s writer for format_name.

Returns None in stub builds where no real OCIO serializer is linked.

Source

pub fn write_to_string_with_const_config( &self, config: &ConstConfig, format_name: impl AsRef<str>, ) -> Result<Option<String>>

Serialize using a retained read-only native config without copying it.

Source

pub fn format_metadata(&self) -> Option<FormatMetadata>

Return format metadata attached to the group, when available.

Source

pub fn format_metadata_v1(&self) -> Option<FormatMetadata>

👎Deprecated since 0.2.0:

compat alias; prefer format_metadata()

Source

pub fn format_metadata_v2(&self) -> Option<FormatMetadata>

👎Deprecated since 0.2.0:

compat alias; prefer format_metadata()

Source

pub fn num_write_formats() -> i32

Return the number of serialization formats supported by write_to_string.

Source

pub fn format_name_by_index(index: i32) -> Option<String>

Return the writer format name at index, or None for an invalid index.

Source

pub fn format_extension_by_index(index: i32) -> Option<String>

Return the writer format extension at index, without a leading dot. Returns None for an invalid index.

Trait Implementations§

Source§

impl Drop for GroupTransform

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 TransformHandle for GroupTransform

Source§

fn as_ptr(&self) -> *mut c_void

Source§

fn diagnostic_text(&self) -> Result<String>

Return OCIO’s diagnostic representation, which may include file paths. This text is not a stable interchange format.
Source§

fn try_type_tag(&self) -> Result<i32>

Return the version-independent tag corresponding to crate::TransformType.
Source§

fn try_set_direction(&mut self, direction: TransformDirection) -> Result<()>

Change the native evaluation direction without modifying the stored parameters.
Source§

fn try_validate(&self) -> Result<()>

Validate the native transform without copying it or building a processor.
Source§

fn try_create_editable_copy(&self) -> Result<Transform>

Create a native editable copy, preserving the concrete transform type. A copied group shares its children with the original. For an independent built-in group graph, use GroupTransform::create_deep_copy.
Source§

fn try_direction(&self) -> Result<TransformDirection>

Query the native direction with validation, for any supported transform.

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.