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< scaledDiscountFromLinrgb, required List<double> >List< linrgbFromScaledDiscount, required List<double> >List< rgbToXyz, required List<double> >List< xyzToRgb, required double trueDelinearize(double), required double linearize(double), required List<double> >double> criticalPlanes}) -
const
-
Gamut.fromPrimaries({required String name, required List<
List< rgbToXyz, required double trueDelinearize(double), required double linearize(double)})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..255to linear0..100. This is the inverse transfer function (EOTF) scaled from0..255range.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..100to display-encoded0..255. This is the transfer function (OETF) scaled to the0..255range.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