Function brettel1997Dichromat

Applies the Brettel, Viénot & Mollon (1997) full-dichromat transform.

LinearSRgb!T brettel1997Dichromat(T)(
  LinearSRgb!T color,
  CvdDeficiency deficiency
) pure nothrow @nogc @safe;

The operation uses the independently validated two-plane linear-sRGB projection for the selected deficiency. It preserves extended linear values and performs no clipping or gamut mapping.

NaN and infinity are not sanitized; ordinary IEEE arithmetic remains visible in the result.

Parameters

NameDescription
color Linear-light sRGB value to transform.
deficiency Protan, deutan, or tritan dichromat family.

Returns

The transformed linear-light sRGB value.

Repeated Use

Prefer prepareBrettel1997Dichromat when applying the same deficiency to multiple colors.

Standards

Brettel, Viénot & Mollon (1997), using the validated modern-sRGB precomputed projection matrices described by the project research.

Example

enum input = LinearSRgbd(0.2, 0.4, 0.7);
enum transformed =
    input.brettel1997Dichromat(
        CvdDeficiency.protan
    );

static assert(
    transformed.r > 0.278633 &&
    transformed.r < 0.278635
);
static assert(
    transformed.g > 0.390039 &&
    transformed.g < 0.390041
);
static assert(
    transformed.b > 0.699648 &&
    transformed.b < 0.699650
);