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.
#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
- c: Vector3
Returns
srgb_to_linear_pow2 :: (c: Vector4) -> Vector4
Squares the red, green and blue channels and leaves alpha as it is.
Parameters
- c: Vector4
Returns
#import "Math";
assert(srgb_to_linear_pow2(xyzw(0.5, 1, 0, 0.3)) == xyzw(0.25, 1, 0, 0.3));