pub struct Lut1d { /* private fields */ }Expand description
Immutable per-channel linear shaper with 2..=65536 samples.
use motion_core::{Cdl, ColorWheels, Lut1d};
let shaper = Lut1d::new([0.0; 3], [16.0; 3], vec![[0.0; 3], [0.8; 3], [1.0; 3]])?;
let look = ColorWheels::default().bake(2, 1.0, Cdl::default())?.with_shaper(shaper);
assert!((look.sample([8.0; 3])[0] - 0.8).abs() < 1e-6);Implementations§
Source§impl Lut1d
impl Lut1d
Sourcepub fn new(
domain_min: [f32; 3],
domain_max: [f32; 3],
data: Vec<[f32; 3]>,
) -> Result<Self, ValidationError>
pub fn new( domain_min: [f32; 3], domain_max: [f32; 3], data: Vec<[f32; 3]>, ) -> Result<Self, ValidationError>
Freezes finite samples and strictly increasing per-channel input domains.
Sourcepub fn domain_min(&self) -> [f32; 3]
pub fn domain_min(&self) -> [f32; 3]
Minimum input domain.
Sourcepub fn domain_max(&self) -> [f32; 3]
pub fn domain_max(&self) -> [f32; 3]
Maximum input domain.
Sourcepub fn from_cube(text: &str) -> Result<Self, ValidationError>
pub fn from_cube(text: &str) -> Result<Self, ValidationError>
Parses a standalone 1D .cube; combined files belong to Lut3d::from_cube.
Trait Implementations§
impl StructuralPartialEq for Lut1d
Auto Trait Implementations§
impl Forget for Lut1d
impl Freeze for Lut1d
impl Move for Lut1d
impl RefUnwindSafe for Lut1d
impl Send for Lut1d
impl Sync for Lut1d
impl Unpin for Lut1d
impl UnsafeUnpin for Lut1d
impl UnwindSafe for Lut1d
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more