4 Color color(float r, float g, float b)
6 return opt.srgb ? Color(r, g, b) : linear_to_srgb(Color(r, g, b));
9 Color linear_to_srgb(const Color &c)
11 const float inv_gamma = 1.0f / 2.2f;
12 return Color(pow(c.x, inv_gamma), pow(c.y, inv_gamma), pow(c.z, inv_gamma));
15 Color srgb_to_linear(const Color &c)
17 const float gamma = 2.2f;
18 return Color(pow(c.x, gamma), pow(c.y, gamma), pow(c.z, gamma));