Color space transformations

Enoki provides a set of helper functions for color space transformations. For now, only sRGB and inverse sRGB gamma correction are available. To use them, include the following header file:

#include <enoki/color.h>

Functions

template<typename Value>
Value linear_to_srgb(Value value)

Efficiently applies the sRGB gamma correction

\[\begin{split}x\mapsto\begin{cases}12.92x,&x\leq 0.0031308\\1.055x^{1/2.4}-0.055,&x>0.0031308\end{cases}\end{split}\]

to an input value in the interval \((0, 1)\).

template<typename Value>
Value srgb_to_linear(Value value)

Efficiently applies the inverse sRGB gamma correction

\[\begin{split}x\mapsto{\begin{cases}{\frac {x}{12.92}},&x\leq 0.04045\\\left({\frac {x+0.055}{1.055}}\right)^{2.4},&x>0.04045\end{cases}}\end{split}\]

to an input value in the interval \((0, 1)\).