Function vienot1999Dichromat

Applies the Viénot, Brettel & Mollon (1999) full-deficiency display transform for protan or deutan dichromacy.

LinearSRgb!T vienot1999Dichromat(T)(
  LinearSRgb!T color,
  RedGreenCvdDeficiency deficiency
) pure nothrow @nogc @safe;

The operation is a single 3x3 transform in linear-light sRGB. Tritan is not part of this production contract; use the Brettel 1997 transform when a promoted tritan dichromat simulation is required.

The transform preserves extended values and does not clip or gamut-map. NaN and infinity remain visible through ordinary IEEE arithmetic.

Parameters

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

Returns

The transformed linear-light sRGB value.

Repeated Use

Prefer prepareVienot1999Dichromat when applying the same deficiency to multiple colors.

Standards

Viénot, Brettel & Mollon (1999), using the independently validated modern-sRGB matrices preserved by the project research.

Example

enum input = LinearSRgbd(0.2, 0.4, 0.7);
enum transformed =
    input.vienot1999Dichromat(
        RedGreenCvdDeficiency.deutan
    );

static assert(
    transformed.r > 0.341449 &&
    transformed.r < 0.341451
);
static assert(
    transformed.g > 0.341449 &&
    transformed.g < 0.341451
);
static assert(
    transformed.b > 0.704467 &&
    transformed.b < 0.704469
);