Module color.rgb

Encoded and linear-light sRGB values.

Use SRgb for nonlinear sRGB channel values such as display- or image-facing data. Use LinearSRgb when an operation requires linear light. Convert explicitly with toLinear and toSRgb; neither conversion clips or gamut-maps extended values.

Functions

NameDescription
decodeSrgbBatch(input, output) Decodes a batch with the exact scalar sRGB transfer semantics.
encodeSrgbBatch(input, output) Encodes a batch with the exact scalar sRGB transfer semantics.
makeSRgb8Decoder() Builds a reusable exact lookup table for encoded sRGB bytes.
toLinear(color) Decodes an sRGB value for calculations that require linear light.
toSRgb(color) Encodes a linear-light value as nonlinear sRGB.

Structs

NameDescription
LinearSRgb Stores linear-light sRGB channel values.
SRgb Stores nonlinear sRGB channel values.
SRgb8Decoder Reusable exact decode table for all 256 encoded sRGB byte values.

Aliases

NameTypeDescription
LinearSRgbd LinearSRgb!(double) Linear-light sRGB with double components.
LinearSRgbf LinearSRgb!(float) Linear-light sRGB with float components.
SRgbd SRgb!(double) Encoded sRGB with double components.
SRgbf SRgb!(float) Encoded sRGB with float components.