pub struct ConstTransform { /* private fields */ }Expand description
Shared immutable native transform, which can be processed without copying.
Implementations§
Source§impl ConstTransform
impl ConstTransform
Sourcepub fn group_child_count(&self) -> Result<i32>
pub fn group_child_count(&self) -> Result<i32>
Count children of a native group without copying it. A non-group transform returns an error.
Sourcepub fn group_child(&self, index: i32) -> Result<Option<Self>>
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.
Sourcepub fn diagnostic_text(&self) -> Result<String>
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.
Sourcepub fn type_tag(&self) -> Result<i32>
pub fn type_tag(&self) -> Result<i32>
Version-independent discriminant corresponding to crate::TransformType.
Sourcepub fn try_direction(&self) -> Result<TransformDirection>
pub fn try_direction(&self) -> Result<TransformDirection>
Query the native direction, rejecting unrecognized values.
Sourcepub fn validate(&self) -> Result<()>
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.
Sourcepub fn create_editable_copy(&self) -> Result<Transform>
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.
Sourcepub unsafe fn with_readonly_raw_handle<R>(
&self,
read: impl FnOnce(*mut c_void) -> R,
) -> Result<R>
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.
Sourcepub unsafe fn with_readonly_metadata<R>(
&self,
read: impl FnOnce(Option<&ConstFormatMetadata>) -> R,
) -> Result<R>
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.