Skip to main content

CDLTransform

Struct CDLTransform 

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

ASC CDL slope/offset/power and saturation transform.

Fallible getters preserve native errors; compatibility getters retain their fallback values when a native query fails.

Implementations§

Source§

impl CDLTransform

Source

pub fn create() -> Result<Self>

Create a new empty CDL transform.

Source

pub fn create_from_file( src: impl AsRef<str>, ccc_id: impl AsRef<str>, ) -> Result<Self>

Create a CDL transform from a CCC file and optional id.

Source

pub fn create_group_from_file(src: impl AsRef<str>) -> Result<GroupTransform>

Create a group transform from a CCC file.

Source

pub fn try_slope(&self) -> Result<[f64; 3]>

Return the per-channel slope values.

Source

pub fn slope(&self) -> [f64; 3]

Return the per-channel slope values.

Source

pub fn set_slope(&self, rgb: &[f64; 3])

Set the per-channel slope values.

Source

pub fn try_set_slope(&self, rgb: &[f64; 3]) -> Result<()>

Set slope values and surface any OCIO validation error.

Source

pub fn try_offset(&self) -> Result<[f64; 3]>

Return the per-channel offset values.

Source

pub fn offset(&self) -> [f64; 3]

Return the per-channel offset values.

Source

pub fn set_offset(&self, rgb: &[f64; 3])

Set the per-channel offset values.

Source

pub fn try_set_offset(&self, rgb: &[f64; 3]) -> Result<()>

Set offset values and surface any OCIO validation error.

Source

pub fn try_power_(&self) -> Result<[f64; 3]>

Return the per-channel power values.

Source

pub fn power_(&self) -> [f64; 3]

Return the per-channel power values.

Source

pub fn set_power(&self, rgb: &[f64; 3])

Set the per-channel power values.

Source

pub fn try_set_power(&self, rgb: &[f64; 3]) -> Result<()>

Set power values and surface any OCIO validation error.

Source

pub fn try_sat(&self) -> Result<f64>

Return the saturation value.

Source

pub fn sat(&self) -> f64

Return the saturation value.

Source

pub fn set_sat(&self, sat: f64)

Set the saturation value.

Source

pub fn try_set_sat(&self, sat: f64) -> Result<()>

Set saturation and surface any OCIO validation error.

Source

pub fn try_sat_luma_coefs(&self) -> Result<[f64; 3]>

Return the luma coefficients used for saturation.

Source

pub fn sat_luma_coefs(&self) -> [f64; 3]

Return the luma coefficients used for saturation.

Source

pub fn style(&self) -> CDLStyle

Return the current CDL style, or Asc if the query fails.

Source

pub fn try_style(&self) -> Result<CDLStyle>

Return the current CDL style, preserving native query errors.

Source

pub fn set_style(&self, style: CDLStyle)

Set the CDL style.

Source

pub fn try_set_style(&self, style: CDLStyle) -> Result<()>

Set the CDL style and surface any OCIO validation error.

Source

pub fn id(&self) -> Option<String>

Return the CDL transform id, or None if the query fails.

Source

pub fn try_id(&self) -> Result<Option<String>>

Return the CDL id, preserving native query errors.

Source

pub fn set_id(&self, id: impl AsRef<str>) -> Result<()>

Set the CDL transform id.

Source

pub fn direction(&self) -> TransformDirection

Return the transform direction.

Source

pub fn set_direction(&self, direction: TransformDirection)

Set the transform direction.

Source

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

Set the transform direction and surface any OCIO validation error.

Source

pub fn try_sop(&self) -> Result<[f64; 9]>

Return the slope, offset, and power values as a 9-element array.

Source

pub fn sop(&self) -> [f64; 9]

Return the slope, offset, and power values as a 9-element array.

Source

pub fn set_sop(&self, vec9: &[f64; 9])

Set the slope, offset, and power values from a 9-element array.

Source

pub fn try_set_sop(&self, vec9: &[f64; 9]) -> Result<()>

Set slope, offset, and power in one call and surface any OCIO validation error.

Source

pub fn first_sop_description(&self) -> Option<String>

Return the first SOP description, or None if the query fails.

Source

pub fn try_first_sop_description(&self) -> Result<Option<String>>

Return the first SOP description, preserving native query errors.

Source

pub fn set_first_sop_description(&self, desc: impl AsRef<str>) -> Result<()>

Set the first SOP description.

Source

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

Create an independent copy of this transform.

Source

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

Return format metadata attached to the transform, 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 equals(&self, other: &Self) -> bool

Return whether this transform is equivalent to other.

Trait Implementations§

Source§

impl Drop for CDLTransform

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 CDLTransform

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.