Srgb module

srgb_to_linear_pow2

procedure2 overloadsSource

A rough srgb_to_linear that squares each channel (gamma 2.0). Cheap, and close in the middle of the range, but off near black.

Example↗
#import "Math";
assert(srgb_to_linear_pow2(xyz(0.5, 1, 0)) == xyz(0.25, 1, 0));
srgb_to_linear_pow2 :: (c: Vector3) -> Vector3

Parameters

Returns

srgb_to_linear_pow2 :: (c: Vector4) -> Vector4

Squares the red, green and blue channels and leaves alpha as it is.

Parameters

Returns

Example↗
#import "Math";
assert(srgb_to_linear_pow2(xyzw(0.5, 1, 0, 0.3)) == xyzw(0.25, 1, 0, 0.3));

See also