Gamut class

Defines the gamut-specific constants that the HCT solver needs.

A gamut is defined by:

  • Its RGB-to-XYZ matrix (determined by the RGB primaries and white point)
  • Its transfer function (EOTF/OETF, i.e. "gamma")

The solver uses precomputed composite matrices that bake together the RGB-to-XYZ conversion with CAM16's chromatic adaptation, plus a lookup table of "critical planes" derived from the transfer function.

Three standard gamuts are provided: srgb, displayP3, and rec2020.

Constructors

Gamut({required String name, required List<double> yFromLinrgb, required List<List<double>> scaledDiscountFromLinrgb, required List<List<double>> linrgbFromScaledDiscount, required List<List<double>> rgbToXyz, required List<List<double>> xyzToRgb, required double trueDelinearize(double), required double linearize(double), required List<double> criticalPlanes})
const
Gamut.fromPrimaries({required String name, required List<List<double>> rgbToXyz, required double trueDelinearize(double), required double linearize(double)})
Creates a Gamut from an RGB-to-XYZ matrix and transfer functions.
factory

Properties

criticalPlanes → List<double>
Precomputed critical planes for the transfer function.
final
hashCode → int
The hash code for this object.
no setterinherited
linearize → double Function(double)
Linearizes a display-encoded RGB component 0..255 to linear 0..100. This is the inverse transfer function (EOTF) scaled from 0..255 range.
final
linrgbFromScaledDiscount → List<List<double>>
Inverse of scaledDiscountFromLinrgb: CAM16 scaled discount → linear RGB.
final
name → String
Human-readable name for debugging.
final
rgbToXyz → List<List<double>>
The full 3x3 linear-RGB-to-XYZ matrix.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaledDiscountFromLinrgb → List<List<double>>
Composite matrix: linear RGB → CAM16 scaled discount. Equals fl/100 * diag(rgbD) * CAT16 * rgbToXyz.
final
trueDelinearize → double Function(double)
Delinearizes a linear RGB component 0..100 to display-encoded 0..255. This is the transfer function (OETF) scaled to the 0..255 range.
final
xyzToRgb → List<List<double>>
The full 3x3 XYZ-to-linear-RGB matrix.
final
yFromLinrgb → List<double>
The Y (luminance) row of the linear-RGB-to-XYZ matrix. For sRGB: 0.2126, 0.7152, 0.0722 (Rec. 709 primaries).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

displayP3 → Gamut
Display P3 gamut.
final
rec2020 → Gamut
Rec. 2020 gamut.
final
srgb → Gamut
sRGB / Rec. 709 gamut.
final