Skip to main content

Lut3d

Struct Lut3d 

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

Validated three-dimensional cube, with red varying fastest.

Implementations§

Source§

impl Lut3d

Source

pub fn new( size: u16, domain_min: [f32; 3], domain_max: [f32; 3], data: Vec<[f32; 3]>, ) -> Result<Self, ValidationError>

Freezes a finite 2..=64 cube with a strictly increasing per-channel domain.

Source

pub fn from_cube(text: &str) -> Result<Self, ValidationError>

Parses a bounded 3D .cube, optionally preceded by a 1D shaper.

In combined files DOMAIN_MIN/MAX describe the shaper input. The cube defaults to 0..1 unless LUT_3D_INPUT_RANGE specifies another range.

Source

pub fn size(&self) -> u16

Cube edge length.

Source

pub fn domain_min(&self) -> [f32; 3]

Minimum input domain.

Source

pub fn domain_max(&self) -> [f32; 3]

Maximum input domain.

Source

pub fn data(&self) -> &[[f32; 3]]

Red-fastest immutable samples.

Source

pub fn with_shaper(self, shaper: Lut1d) -> Self

Attaches an input shaper; its output is interpreted in the cube domain.

Source

pub fn shaper(&self) -> Option<&Lut1d>

Optional per-channel input shaper, evaluated before tetrahedral lookup.

Source

pub fn apply(&self, rgb: [f32; 3], input: LutInput) -> [f32; 3]

Encodes linear input, samples a look and decodes its output back to linear.

Source

pub fn sample(&self, rgb: [f32; 3]) -> [f32; 3]

Tetrahedral interpolation; out-of-domain input clamps to the boundary.

Trait Implementations§

Source§

impl Clone for Lut3d

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Lut3d

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Lut3d

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl Forget for Lut3d

§

impl Freeze for Lut3d

§

impl RefUnwindSafe for Lut3d

§

impl Send for Lut3d

§

impl Sync for Lut3d

§

impl Unpin for Lut3d

§

impl UnsafeUnpin for Lut3d

§

impl UnwindSafe for Lut3d

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.