std.experimental.color.colorspace

This module defines and operates on standard color spaces.

Members

Aliases

linearToRec2020
alias linearToRec2020(F) = linearToHybridGamma!(1.09929682680944, 0.018053968510807, 4.5, 0.45, F)

Linear to Rec.2020 transfer function.

linearToRec601
alias linearToRec601(F) = linearToHybridGamma!(1.099, 0.018, 4.5, 0.45, F)

Linear to Rec.601 transfer function. Note, Rec.709 also uses this same function.

linearTosRGB
alias linearTosRGB(F) = linearToHybridGamma!(1.055, 0.0031308, 12.92, 1 / 2.4, F)

Linear to sRGB transfer function.

rec2020ToLinear
alias rec2020ToLinear(F) = hybridGammaToLinear!(1.09929682680944, 0.018053968510807, 4.5, 1 / 0.45, F)

Rec.2020 to linear transfer function.

rec601ToLinear
alias rec601ToLinear(F) = hybridGammaToLinear!(1.099, 0.018, 4.5, 1 / 0.45, F)

Rec.601 to linear transfer function. Note, Rec.709 also uses this same function.

sRGBToLinear
alias sRGBToLinear(F) = hybridGammaToLinear!(1.055, 0.0031308, 12.92, 2.4, F)

sRGB to linear transfer function.

Enums

ChromaticAdaptationMethod
enum ChromaticAdaptationMethod

Chromatic adaptation method.

RGBColorSpace
enum RGBColorSpace

Enum of common RGB color spaces.

Functions

chromaticAdaptationMatrix
F[3][3] chromaticAdaptationMatrix(xyY!F srcWhite, xyY!F destWhite)

Generate a chromatic adaptation matrix from srcWhite to destWhite.

determinant
F determinant(F[3][3] m)
Undocumented in source. Be warned that the author may not have intended to support it.
gammaToLinear
T gammaToLinear(T v)

Gamma to linear transfer function.

gammaToLinear
T gammaToLinear(T v, T gamma)

Gamma to linear transfer function.

hybridGammaToLinear
T hybridGammaToLinear(T v)

Hybrid linear-gamma to linear transfer function. The function and parameters are detailed in the example below.

inverse
F[3][3] inverse(F[3][3] m)
Undocumented in source. Be warned that the author may not have intended to support it.
linearToGamma
T linearToGamma(T v)

Linear to gamma transfer function.

linearToGamma
T linearToGamma(T v, T gamma)

Linear to gamma transfer function.

linearToHybridGamma
T linearToHybridGamma(T v)

Linear to hybrid linear-gamma transfer function. The function and parameters are detailed in the example below.

multiply
F[3] multiply(F[3][3] m1, F[3] v)
Undocumented in source. Be warned that the author may not have intended to support it.
multiply
F[3][3] multiply(F[3][3] m1, F[3][3] m2)
Undocumented in source. Be warned that the author may not have intended to support it.
rgbColorSpaceDef
RGBColorSpaceDesc!F rgbColorSpaceDef(RGBColorSpace colorSpace)

Color space descriptor for the specified color space.

rgbToXyzMatrix
F[3][3] rgbToXyzMatrix(RGBColorSpaceDesc!F cs)

RGB to XYZ color space transformation matrix.
cs describes the source RGB color space.

transpose
F[3][3] transpose(F[3][3] m)
Undocumented in source. Be warned that the author may not have intended to support it.
xyzToRgbMatrix
F[3][3] xyzToRgbMatrix(RGBColorSpaceDesc!F cs)

XYZ to RGB color space transformation matrix.
cs describes the target RGB color space.

Static variables

chromaticAdaptationMatrices
F[3][3][ChromaticAdaptationMethod.max + 1] chromaticAdaptationMatrices(F);
Undocumented in source.
rgbColorSpaceDefs
RGBColorSpaceDesc!F[RGBColorSpace.max + 1] rgbColorSpaceDefs(F);
Undocumented in source.

Structs

RGBColorSpaceDesc
struct RGBColorSpaceDesc(F)

Parameters that define an RGB color space.
F is the float type that should be used for the colors and gamma functions.

Templates

WhitePoint
template WhitePoint(F)

White points of standard illuminants.

Meta

Authors

Manu Evans