Skip to main content

ConstTransform

Struct ConstTransform 

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

Shared immutable native transform, which can be processed without copying.

Implementations§

Source§

impl ConstTransform

Source

pub fn group_child_count(&self) -> Result<i32>

Count children of a native group without copying it. A non-group transform returns an error.

Source

pub fn group_child(&self, index: i32) -> Result<Option<Self>>

Retain one native group child without copying the group or transform. Invalid indices and non-group handles return errors. The returned child can outlive the group.

Source

pub 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

pub fn type_tag(&self) -> Result<i32>

Version-independent discriminant corresponding to crate::TransformType.

Source

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

Query the native direction, rejecting unrecognized values.

Source

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

Validate this transform using OCIO without creating an editable copy.

This checks the transform’s parameters; it does not build a processor or resolve external files.

Source

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

Create an editable copy using the concrete transform’s native semantics. A copied group shares its children with the original. For an independent built-in group graph, use GroupTransform::create_deep_copy.

Source

pub unsafe fn with_readonly_raw_handle<R>( &self, read: impl FnOnce(*mut c_void) -> R, ) -> Result<R>

Access existing low-level getters without copying the native transform.

This creates a temporary typed FFI handle sharing the same native object; it is destroyed when read returns or unwinds. Use type_tag to select getters for the concrete transform type. An unsupported or inconsistent native type returns an error. Errors from FFI calls inside read must be handled by the callback itself.

§Safety

Call only FFI operations corresponding to native const methods. Do not mutate the transform or its descendants, and do not access mutable aliases concurrently. The handle, descendant handles and any pointers or references derived from them must not escape read. Native getters may have additional pointer, buffer, and synchronization requirements. In particular, ocio_transform_get_format_metadata selects the native mutable overload; use Self::with_readonly_metadata instead.

Source

pub unsafe fn with_readonly_metadata<R>( &self, read: impl FnOnce(Option<&ConstFormatMetadata>) -> R, ) -> Result<R>

Inspect native const metadata without copying the transform or metadata. The callback receives None for transform types without metadata.

§Safety

Do not mutate this transform or its metadata through any alias while read runs. Neither borrowed metadata nor any child handles, pointers, or references derived from it may escape the callback.

Trait Implementations§

Source§

impl Drop for ConstTransform

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

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.