Added experiment for new fastCos. More sRGB tests.

This commit is contained in:
Christophe Riccio
2015-06-27 18:36:17 +02:00
parent 83409a0720
commit 08eedc6209
5 changed files with 342 additions and 29 deletions

View File

@@ -39,20 +39,34 @@ namespace srgb
{
int Error(0);
glm::vec4 const ColorSourceRGB(1.0, 0.5, 0.0, 1.0);
glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0);
{
glm::vec4 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB);
glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB);
glm::vec3 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB);
glm::vec3 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB);
Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
}
{
glm::vec4 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB, 2.8f);
glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB, 2.8f);
glm::vec3 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB, 2.8f);
glm::vec3 const ColorRGB = glm::convertSrgbToRgb(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::convertRgbToSrgb(ColorSourceRGBA);
glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB);
Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
}
{
glm::vec4 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGBA, 2.8f);
glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB, 2.8f);
Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
}
return Error;
}
}//namespace srgb