diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-20 03:26:31 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-20 03:26:31 +0000 |
| commit | 30079f036c5f3a79873b4929755dfaf64f9a317b (patch) | |
| tree | 43d38ef8a8827296510c9f4e3e99901f132eb8ba /TextureLoader/src/TextureLoader.cpp | |
| parent | Updates to match API 240022 (diff) | |
| download | DiligentTools-30079f036c5f3a79873b4929755dfaf64f9a317b.tar.gz DiligentTools-30079f036c5f3a79873b4929755dfaf64f9a317b.zip | |
Using srgb conversions from graphics acessories
Diffstat (limited to 'TextureLoader/src/TextureLoader.cpp')
| -rw-r--r-- | TextureLoader/src/TextureLoader.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/TextureLoader/src/TextureLoader.cpp b/TextureLoader/src/TextureLoader.cpp index 045df1b..1f63aae 100644 --- a/TextureLoader/src/TextureLoader.cpp +++ b/TextureLoader/src/TextureLoader.cpp @@ -30,28 +30,10 @@ #include "TextureLoader.h" #include "GraphicsAccessories.h" #include "DDSLoader.h" +#include "ColorConversion.h" namespace Diligent { - static const float a = 0.055f; - - // https://en.wikipedia.org/wiki/SRGB - float SRGBToLinear(float SRGB) - { - if( SRGB < 0.04045f ) - return SRGB / 12.92f; - else - return pow( (SRGB + a) / (1 + a), 2.4f ); - } - - float LinearToSRGB( float c ) - { - if( c < 0.0031308f ) - return 12.92f * c; - else - return (1+a) * pow(c, 1.f/2.4f) - a; - } - template<typename ChannelType> ChannelType SRGBAverage(ChannelType c0, ChannelType c1, ChannelType c2, ChannelType c3) { |
