MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / srgb_to_linear

Function srgb_to_linear

external/astc-encoder/Utils/astc_blend_test.cpp:37–46  ·  view source on GitHub ↗

* @brief Linearize an sRGB value. * * @return The linearized value. */

Source from the content-addressed store, hash-verified

35 * @return The linearized value.
36 */
37static float srgb_to_linear(
38 float a
39) {
40 if (a <= 0.04045f)
41 {
42 return a * (1.0f / 12.92f);
43 }
44
45 return powf((a + 0.055f) * (1.0f / 1.055f), 2.4f);
46}
47
48/**
49 * @brief sRGB gamma-encode a linear value.

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected