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
impl CDLTransform
Sourcepub fn create_from_file(
src: impl AsRef<str>,
ccc_id: impl AsRef<str>,
) -> Result<Self>
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.
Sourcepub fn create_group_from_file(src: impl AsRef<str>) -> Result<GroupTransform>
pub fn create_group_from_file(src: impl AsRef<str>) -> Result<GroupTransform>
Create a group transform from a CCC file.
Sourcepub fn try_set_slope(&self, rgb: &[f64; 3]) -> Result<()>
pub fn try_set_slope(&self, rgb: &[f64; 3]) -> Result<()>
Set slope values and surface any OCIO validation error.
Sourcepub fn try_offset(&self) -> Result<[f64; 3]>
pub fn try_offset(&self) -> Result<[f64; 3]>
Return the per-channel offset values.
Sourcepub fn set_offset(&self, rgb: &[f64; 3])
pub fn set_offset(&self, rgb: &[f64; 3])
Set the per-channel offset values.
Sourcepub fn try_set_offset(&self, rgb: &[f64; 3]) -> Result<()>
pub fn try_set_offset(&self, rgb: &[f64; 3]) -> Result<()>
Set offset values and surface any OCIO validation error.
Sourcepub fn try_power_(&self) -> Result<[f64; 3]>
pub fn try_power_(&self) -> Result<[f64; 3]>
Return the per-channel power values.
Sourcepub fn try_set_power(&self, rgb: &[f64; 3]) -> Result<()>
pub fn try_set_power(&self, rgb: &[f64; 3]) -> Result<()>
Set power values and surface any OCIO validation error.
Sourcepub fn try_set_sat(&self, sat: f64) -> Result<()>
pub fn try_set_sat(&self, sat: f64) -> Result<()>
Set saturation and surface any OCIO validation error.
Sourcepub fn try_sat_luma_coefs(&self) -> Result<[f64; 3]>
pub fn try_sat_luma_coefs(&self) -> Result<[f64; 3]>
Return the luma coefficients used for saturation.
Sourcepub fn sat_luma_coefs(&self) -> [f64; 3]
pub fn sat_luma_coefs(&self) -> [f64; 3]
Return the luma coefficients used for saturation.
Sourcepub fn try_style(&self) -> Result<CDLStyle>
pub fn try_style(&self) -> Result<CDLStyle>
Return the current CDL style, preserving native query errors.
Sourcepub fn try_set_style(&self, style: CDLStyle) -> Result<()>
pub fn try_set_style(&self, style: CDLStyle) -> Result<()>
Set the CDL style and surface any OCIO validation error.
Sourcepub fn try_id(&self) -> Result<Option<String>>
pub fn try_id(&self) -> Result<Option<String>>
Return the CDL id, preserving native query errors.
Sourcepub fn direction(&self) -> TransformDirection
pub fn direction(&self) -> TransformDirection
Return the transform direction.
Sourcepub fn set_direction(&self, direction: TransformDirection)
pub fn set_direction(&self, direction: TransformDirection)
Set the transform direction.
Sourcepub fn try_set_direction(&self, direction: TransformDirection) -> Result<()>
pub fn try_set_direction(&self, direction: TransformDirection) -> Result<()>
Set the transform direction and surface any OCIO validation error.
Sourcepub fn try_sop(&self) -> Result<[f64; 9]>
pub fn try_sop(&self) -> Result<[f64; 9]>
Return the slope, offset, and power values as a 9-element array.
Sourcepub fn set_sop(&self, vec9: &[f64; 9])
pub fn set_sop(&self, vec9: &[f64; 9])
Set the slope, offset, and power values from a 9-element array.
Sourcepub fn try_set_sop(&self, vec9: &[f64; 9]) -> Result<()>
pub fn try_set_sop(&self, vec9: &[f64; 9]) -> Result<()>
Set slope, offset, and power in one call and surface any OCIO validation error.
Sourcepub fn first_sop_description(&self) -> Option<String>
pub fn first_sop_description(&self) -> Option<String>
Return the first SOP description, or None if the query fails.
Sourcepub fn try_first_sop_description(&self) -> Result<Option<String>>
pub fn try_first_sop_description(&self) -> Result<Option<String>>
Return the first SOP description, preserving native query errors.
Sourcepub fn set_first_sop_description(&self, desc: impl AsRef<str>) -> Result<()>
pub fn set_first_sop_description(&self, desc: impl AsRef<str>) -> Result<()>
Set the first SOP description.
Sourcepub fn create_editable_copy(&self) -> Result<Self>
pub fn create_editable_copy(&self) -> Result<Self>
Create an independent copy of this transform.
Sourcepub fn format_metadata(&self) -> Option<FormatMetadata>
pub fn format_metadata(&self) -> Option<FormatMetadata>
Return format metadata attached to the transform, when available.
pub fn format_metadata_v1(&self) -> Option<FormatMetadata>
compat alias; prefer format_metadata()
pub fn format_metadata_v2(&self) -> Option<FormatMetadata>
compat alias; prefer format_metadata()
Trait Implementations§
Source§impl Drop for CDLTransform
impl Drop for CDLTransform
Source§impl TransformHandle for CDLTransform
impl TransformHandle for CDLTransform
fn as_ptr(&self) -> *mut c_void
Source§fn diagnostic_text(&self) -> Result<String>
fn diagnostic_text(&self) -> Result<String>
Source§fn try_type_tag(&self) -> Result<i32>
fn try_type_tag(&self) -> Result<i32>
crate::TransformType.Source§fn try_set_direction(&mut self, direction: TransformDirection) -> Result<()>
fn try_set_direction(&mut self, direction: TransformDirection) -> Result<()>
Source§fn try_validate(&self) -> Result<()>
fn try_validate(&self) -> Result<()>
Source§fn try_create_editable_copy(&self) -> Result<Transform>
fn try_create_editable_copy(&self) -> Result<Transform>
GroupTransform::create_deep_copy.