Moved color_encoding to experimental

This commit is contained in:
Christophe Riccio
2016-11-20 21:50:12 +01:00
parent e6ee4bc90d
commit d4019aab40
8 changed files with 20 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
glmCreateTestGTC(gtx_associated_min_max)
glmCreateTestGTC(gtx_closest_point)
glmCreateTestGTC(gtx_color_encoding)
glmCreateTestGTC(gtx_color_space_YCoCg)
glmCreateTestGTC(gtx_color_space)
glmCreateTestGTC(gtx_common)

View File

@@ -0,0 +1,51 @@
#include <glm/gtc/color_encoding.hpp>
#include <glm/gtc/color_space.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtc/constants.hpp>
namespace srgb
{
int test()
{
int Error(0);
glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0);
/*
{
glm::vec3 const ColorSRGB = glm::convertLinearSRGBToD65XYZ(ColorSourceRGB);
glm::vec3 const ColorRGB = glm::convertD65XYZToLinearSRGB(ColorSRGB);
Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
}
*/
{
glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f);
glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
}
glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0);
{
glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA);
glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB);
Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
}
{
glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f);
glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
}
return Error;
}
}//namespace srgb
int main()
{
int Error(0);
Error += srgb::test();
return Error;
}