From 30079f036c5f3a79873b4929755dfaf64f9a317b Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 19 Apr 2019 20:26:31 -0700 Subject: Using srgb conversions from graphics acessories --- TextureLoader/src/TextureLoader.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'TextureLoader/src/TextureLoader.cpp') 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 ChannelType SRGBAverage(ChannelType c0, ChannelType c1, ChannelType c2, ChannelType c3) { -- cgit v1.2.3