diff options
author | Geenz <geenz@geenzo.com> | 2019-03-29 11:57:45 -0700 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2019-03-29 11:57:45 -0700 |
commit | 0272c47e5a31cf972e02fbf14cb2642f86f75d78 (patch) | |
tree | 030d1e05727a42d3a864e019601247df0ae869a0 /indra/llmath | |
parent | f3ea75cfa903f5dedc01930a50312049f4207e46 (diff) |
Tweaked naming a bit, also white space.
Will wait for a response from @graham_linden regarding moving the sRGB conversion functions in llmath.h to llrender.
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llmath.h | 24 | ||||
-rw-r--r-- | indra/llmath/v4color.h | 12 | ||||
-rw-r--r-- | indra/llmath/v4math.h | 12 |
3 files changed, 24 insertions, 24 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index bb19248f1f..57f2489a2d 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -540,21 +540,21 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k) // This converts from a non-linear sRGB floating point value (0..1) to a linear value. // Useful for gamma correction and such. Note: any values passed through this should not be serialized. You should also ideally cache the output of this. inline float sRGBtoLinear(const float val) { - if (val < 0.0031308f) { - return val * 12.92f; - } - else { - return 1.055f * pow(val, 1.0f / 2.4f) - 0.055f; - } + if (val < 0.0031308f) { + return val * 12.92f; + } + else { + return 1.055f * pow(val, 1.0f / 2.4f) - 0.055f; + } } inline float linearTosRGB(const float val) { - if (val < 0.04045f) { - return val / 12.92f; - } - else { - return pow((val + 0.055f) / 1.055f, 2.4f); - } + if (val < 0.04045f) { + return val / 12.92f; + } + else { + return pow((val + 0.055f) / 1.055f, 2.4f); + } } // Include simd math header diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index d9dd28ec54..6b91b4f191 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -657,14 +657,14 @@ void LLColor4::clamp() } inline const LLColor4 srgbColor4(const LLColor4 &a) { - LLColor4 srgbColor; + LLColor4 srgbColor; - srgbColor.mV[0] = linearTosRGB(a.mV[0]); - srgbColor.mV[1] = linearTosRGB(a.mV[1]); - srgbColor.mV[2] = linearTosRGB(a.mV[2]); - srgbColor.mV[3] = a.mV[3]; + srgbColor.mV[0] = linearTosRGB(a.mV[0]); + srgbColor.mV[1] = linearTosRGB(a.mV[1]); + srgbColor.mV[2] = linearTosRGB(a.mV[2]); + srgbColor.mV[3] = a.mV[3]; - return srgbColor; + return srgbColor; } #endif diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 00baeefa5c..b8835ba2e4 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -536,14 +536,14 @@ inline F32 LLVector4::normVec(void) // Because apparently some parts of the viewer use this for color info. inline const LLVector4 srgbVector4(const LLVector4 &a) { - LLVector4 srgbColor; + LLVector4 srgbColor; - srgbColor.mV[0] = linearTosRGB(a.mV[0]); - srgbColor.mV[1] = linearTosRGB(a.mV[1]); - srgbColor.mV[2] = linearTosRGB(a.mV[2]); - srgbColor.mV[3] = a.mV[3]; + srgbColor.mV[0] = linearTosRGB(a.mV[0]); + srgbColor.mV[1] = linearTosRGB(a.mV[1]); + srgbColor.mV[2] = linearTosRGB(a.mV[2]); + srgbColor.mV[3] = a.mV[3]; - return srgbColor; + return srgbColor; } |