pub struct Lut3dData {
pub edge_length: u32,
pub domain_min: [f32; 3],
pub domain_max: [f32; 3],
pub values: Vec<[f32; 3]>,
}Expand description
Canonical RGB samples for one cubic 3D lookup table.
Fields§
§edge_length: u32Equal width, height, and depth of the cube.
domain_min: [f32; 3]Per-channel input-domain lower bound declared by the file.
domain_max: [f32; 3]Per-channel input-domain upper bound declared by the file.
values: Vec<[f32; 3]>RGB samples in blue-major, green-middle, red-fastest order.
Implementations§
Source§impl Lut3dData
impl Lut3dData
Sourcepub fn from_cube(text: &str) -> Result<Self, LutParseError>
pub fn from_cube(text: &str) -> Result<Self, LutParseError>
Parses the portable 3D subset of the Adobe/Resolve .cube text format.
TITLE, comments, per-channel domains, and LUT_3D_INPUT_RANGE are
accepted, as are CRLF line ends and a leading UTF-8 byte order mark,
which a browser’s text decoding removes and std::fs::read_to_string
keeps: every host parses the same file alike. One-dimensional tables
are rejected instead of being silently interpreted as a different
color transform.
§Errors
Returns a line-oriented diagnostic for malformed or unsupported input.