pub struct Lut {
pub title: Option<String>,
pub size: usize,
pub domain_min: [f32; 3],
pub domain_max: [f32; 3],
pub data: Vec<[f32; 3]>,
pub path: Option<PathBuf>,
}Expand description
A 3D LUT: size^3 RGB entries, red varying fastest (.cube order).
Fields§
§title: Option<String>§size: usize§domain_min: [f32; 3]§domain_max: [f32; 3]§data: Vec<[f32; 3]>size^3 entries, index r + g * size + b * size * size.
path: Option<PathBuf>Where it was loaded from, if anywhere.
Implementations§
Source§impl Lut
impl Lut
Sourcepub fn from_cube_file(path: impl AsRef<Path>) -> Result<Lut, Error>
pub fn from_cube_file(path: impl AsRef<Path>) -> Result<Lut, Error>
Reads an Adobe/Resolve .cube 3D LUT.
Sourcepub fn mixed(self, strength: f32) -> Lut
pub fn mixed(self, strength: f32) -> Lut
This LUT mixed with identity by strength (0..1, lut_strength): each lattice entry
moved from its identity value (in the LUT’s domain) towards its own by strength.
Sourcepub fn at(&self, r: usize, g: usize, b: usize) -> [f32; 3]
pub fn at(&self, r: usize, g: usize, b: usize) -> [f32; 3]
Nearest-entry lookup at lattice coordinates (for tests and debugging; the GPU interpolates).
Sourcepub fn sample(&self, rgb: [f32; 3]) -> [f32; 3]
pub fn sample(&self, rgb: [f32; 3]) -> [f32; 3]
Trilinear lookup of rgb (in the LUT’s domain, clamped to it): how libplacebo samples a
pl_custom_lut (a linearly filtered 3D texture), so baked LUTs agree with the GPU.
Sourcepub fn with_input_gain(&self, gain: [f32; 3]) -> Lut
pub fn with_input_gain(&self, gain: [f32; 3]) -> Lut
This LUT after a per-channel gain on its input, clamped to 0..1 (ffmpeg’s
colorchannelmixer rr:gg:bb ahead of lut3d), resampled on the same lattice.