SRGB_TO_LINEAR_RGB_TABLE

Constant SRGB_TO_LINEAR_RGB_TABLE 

Source
const SRGB_TO_LINEAR_RGB_TABLE: &[u8; 256];
Expand description

Precomputed sRGB to LinearRGB table.

Since we are storing the result in u8, there is no need to compute those values each time. Mainly because it’s very expensive.

if (C_srgb <= 0.04045)
    C_lin = C_srgb / 12.92;
 else
    C_lin = pow((C_srgb + 0.055) / 1.055, 2.4);

Thanks to librsvg for the idea.