pub struct MatrixTransform { /* private fields */ }Expand description
A 4x4 matrix transform plus RGBA offset.
Matrix transforms are commonly used for channel scaling, saturation, luminance views, and fitted range remapping.
Implementations§
Source§impl MatrixTransform
impl MatrixTransform
Sourcepub fn fit_into(
m: &mut [f64; 16],
o: &mut [f64; 4],
old_min: &[f64; 4],
old_max: &[f64; 4],
new_min: &[f64; 4],
new_max: &[f64; 4],
) -> Result<()>
pub fn fit_into( m: &mut [f64; 16], o: &mut [f64; 4], old_min: &[f64; 4], old_max: &[f64; 4], new_min: &[f64; 4], new_max: &[f64; 4], ) -> Result<()>
Write OCIO’s fitted matrix and offset into caller-owned arrays. On error, the output arrays may have been partially modified by OCIO.
Sourcepub fn sat_into(
m: &mut [f64; 16],
o: &mut [f64; 4],
sat: f64,
luma: &[f64; 3],
) -> Result<()>
pub fn sat_into( m: &mut [f64; 16], o: &mut [f64; 4], sat: f64, luma: &[f64; 3], ) -> Result<()>
Write OCIO’s saturation matrix and offset without creating a transform.
Sourcepub fn scale_into(
m: &mut [f64; 16],
o: &mut [f64; 4],
scale: &[f64; 4],
) -> Result<()>
pub fn scale_into( m: &mut [f64; 16], o: &mut [f64; 4], scale: &[f64; 4], ) -> Result<()>
Write OCIO’s channel-scale matrix and offset without creating a transform.
Sourcepub fn view_into(
m: &mut [f64; 16],
o: &mut [f64; 4],
channels: &mut [i32; 4],
luma: &[f64; 3],
) -> Result<()>
pub fn view_into( m: &mut [f64; 16], o: &mut [f64; 4], channels: &mut [i32; 4], luma: &[f64; 3], ) -> Result<()>
Write OCIO’s view matrix and offset, preserving native channel-mask semantics.
Sourcepub fn try_matrix(&self) -> Result<[f64; 16]>
pub fn try_matrix(&self) -> Result<[f64; 16]>
Return the current 4x4 matrix in row-major order.
Sourcepub fn set_matrix(&self, m44: &[f64; 16]) -> Result<()>
pub fn set_matrix(&self, m44: &[f64; 16]) -> Result<()>
Replace the current 4x4 matrix in row-major order.
Sourcepub fn try_offset(&self) -> Result<[f64; 4]>
pub fn try_offset(&self) -> Result<[f64; 4]>
Return the current RGBA offset vector.
Sourcepub fn set_offset(&self, offset4: &[f64; 4]) -> Result<()>
pub fn set_offset(&self, offset4: &[f64; 4]) -> Result<()>
Replace the current RGBA offset vector.
Sourcepub fn direction(&self) -> TransformDirection
pub fn direction(&self) -> TransformDirection
Return the transform direction used when this op is evaluated.
Sourcepub fn set_direction(&self, direction: TransformDirection)
pub fn set_direction(&self, direction: TransformDirection)
Set the transform direction used when this op is evaluated.
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 create_editable_copy(&self) -> Result<Self>
pub fn create_editable_copy(&self) -> Result<Self>
Create an editable copy that is independent from the original transform.
Sourcepub fn file_input_bit_depth(&self) -> BitDepth
pub fn file_input_bit_depth(&self) -> BitDepth
Return the bit depth declared for file-based input serialization.
Sourcepub fn set_file_input_bit_depth(&self, bit_depth: BitDepth)
pub fn set_file_input_bit_depth(&self, bit_depth: BitDepth)
Set the bit depth declared for file-based input serialization.
Sourcepub fn try_set_file_input_bit_depth(&self, bit_depth: BitDepth) -> Result<()>
pub fn try_set_file_input_bit_depth(&self, bit_depth: BitDepth) -> Result<()>
Set the serialized input bit depth and surface any OCIO validation error.
Sourcepub fn file_output_bit_depth(&self) -> BitDepth
pub fn file_output_bit_depth(&self) -> BitDepth
Return the bit depth declared for file-based output serialization.
Sourcepub fn set_file_output_bit_depth(&self, bit_depth: BitDepth)
pub fn set_file_output_bit_depth(&self, bit_depth: BitDepth)
Set the bit depth declared for file-based output serialization.
Sourcepub fn try_set_file_output_bit_depth(&self, bit_depth: BitDepth) -> Result<()>
pub fn try_set_file_output_bit_depth(&self, bit_depth: BitDepth) -> Result<()>
Set the serialized output bit depth and surface any OCIO validation error.
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()
Source§impl MatrixTransform
impl MatrixTransform
Sourcepub fn fit(
old_min: &[f64; 4],
old_max: &[f64; 4],
new_min: &[f64; 4],
new_max: &[f64; 4],
) -> Result<Self>
pub fn fit( old_min: &[f64; 4], old_max: &[f64; 4], new_min: &[f64; 4], new_max: &[f64; 4], ) -> Result<Self>
Create a matrix transform that remaps the inclusive range
old_min..old_max into new_min..new_max.
Trait Implementations§
Source§impl Drop for MatrixTransform
impl Drop for MatrixTransform
Source§impl TransformHandle for MatrixTransform
impl TransformHandle for MatrixTransform
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.