Enum LutInterpolation
- Namespace
- Egami.Operations
- Assembly
- Egami.dll
How a Lut3D reads between its grid points.
public enum LutInterpolation
Fields
Nearest = 2Takes the nearest grid point, for tables meant as exact maps.
Tetrahedral = 0Splits each grid cell into six tetrahedra and blends four points (Kasson and others, 1995), as DaVinci Resolve and OpenColorIO do: grays stay exactly on the gray axis. The default.
Trilinear = 1Blends the eight corners of the cell, as ImageMagick's -hald-clut does.
Examples
// Export a grade for DaVinci Resolve or Premiere, then load a .cube file and apply it at 70%.
ColorFilter grade = ColorFilter.Curves(ToneCurve.FromPoints([(0, 0), (0.25f, 0.2f), (0.75f, 0.82f), (1, 1)]))
.Then(ColorFilter.Saturation(1.1f));
CubeFile.Write("my-grade.cube", grade.ToLut3D(size: 33), title: "My grade");
Lut3D lut = CubeFile.Read("my-grade.cube");
raster.Apply(o => o.ApplyFilter(ColorFilter.Lerp(ColorFilter.Identity, ColorFilter.FromLut(lut), 0.7f)), Ct);
// Tables can also be built from a function, and read at any color.
Lut3D warm = Lut3D.FromFunction(c => new Vector3(c.X, c.Y * 0.97f, c.Z * 0.9f), size: 17);
Vector3 gray = warm.Evaluate(new Vector3(0.5f), LutInterpolation.Tetrahedral);