mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 18:24:35 +00:00
Moved color_encoding to experimental
This commit is contained in:
parent
e6ee4bc90d
commit
d4019aab40
@ -35,7 +35,6 @@
|
|||||||
#endif//GLM_MESSAGES
|
#endif//GLM_MESSAGES
|
||||||
|
|
||||||
#include "./gtc/bitfield.hpp"
|
#include "./gtc/bitfield.hpp"
|
||||||
#include "./gtc/color_encoding.hpp"
|
|
||||||
#include "./gtc/color_space.hpp"
|
#include "./gtc/color_space.hpp"
|
||||||
#include "./gtc/constants.hpp"
|
#include "./gtc/constants.hpp"
|
||||||
#include "./gtc/epsilon.hpp"
|
#include "./gtc/epsilon.hpp"
|
||||||
@ -64,6 +63,7 @@
|
|||||||
#include "./gtx/associated_min_max.hpp"
|
#include "./gtx/associated_min_max.hpp"
|
||||||
#include "./gtx/bit.hpp"
|
#include "./gtx/bit.hpp"
|
||||||
#include "./gtx/closest_point.hpp"
|
#include "./gtx/closest_point.hpp"
|
||||||
|
#include "./gtx/color_encoding.hpp"
|
||||||
#include "./gtx/color_space.hpp"
|
#include "./gtx/color_space.hpp"
|
||||||
#include "./gtx/color_space_YCoCg.hpp"
|
#include "./gtx/color_space_YCoCg.hpp"
|
||||||
#include "./gtx/compatibility.hpp"
|
#include "./gtx/compatibility.hpp"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/// @ref gtc_color_encoding
|
/// @ref gtx_color_encoding
|
||||||
/// @file glm/gtc/color_encoding.hpp
|
/// @file glm/gtx/color_encoding.hpp
|
||||||
///
|
///
|
||||||
/// @see core (dependence)
|
/// @see core (dependence)
|
||||||
/// @see gtc_color_encoding (dependence)
|
/// @see gtx_color_encoding (dependence)
|
||||||
///
|
///
|
||||||
/// @defgroup gtc_color_encoding GLM_GTC_color_encoding
|
/// @defgroup gtx_color_encoding GLM_GTX_color_encoding
|
||||||
/// @ingroup gtc
|
/// @ingroup gtx
|
||||||
///
|
///
|
||||||
/// @brief Allow to perform bit operations on integer values
|
/// @brief Allow to perform bit operations on integer values
|
||||||
///
|
///
|
||||||
@ -25,21 +25,21 @@
|
|||||||
|
|
||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
/// @addtogroup gtc_color_encoding
|
/// @addtogroup gtx_color_encoding
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// Convert a linear sRGB color to D65 YUV.
|
/// Convert a linear sRGB color to D65 YUV.
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL tvec3<T, P> convertLinearSRGBToD65XYZ(tvec3<T, P> const& ColorLinearSRGB);
|
GLM_FUNC_DECL tvec3<T, P> convertLinearSRGBToD65XYZ(tvec3<T, P> const& ColorLinearSRGB);
|
||||||
|
|
||||||
|
/// Convert a linear sRGB color to D50 YUV.
|
||||||
|
template <typename T, precision P>
|
||||||
|
GLM_FUNC_DECL tvec3<T, P> convertLinearSRGBToD50XYZ(tvec3<T, P> const& ColorLinearSRGB);
|
||||||
|
|
||||||
/// Convert a D65 YUV color to linear sRGB.
|
/// Convert a D65 YUV color to linear sRGB.
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL tvec3<T, P> convertD65XYZToLinearSRGB(tvec3<T, P> const& ColorD65XYZ);
|
GLM_FUNC_DECL tvec3<T, P> convertD65XYZToLinearSRGB(tvec3<T, P> const& ColorD65XYZ);
|
||||||
|
|
||||||
/// Convert a D50 YUV color to D65 YUV.
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_DECL tvec3<T, P> convertD50XYZToD65XYZ(tvec3<T, P> const& ColorD50XYZ);
|
|
||||||
|
|
||||||
/// Convert a D65 YUV color to D50 YUV.
|
/// Convert a D65 YUV color to D50 YUV.
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL tvec3<T, P> convertD65XYZToD50XYZ(tvec3<T, P> const& ColorD65XYZ);
|
GLM_FUNC_DECL tvec3<T, P> convertD65XYZToD50XYZ(tvec3<T, P> const& ColorD65XYZ);
|
@ -1,5 +1,5 @@
|
|||||||
/// @ref gtc_color_encoding
|
/// @ref gtx_color_encoding
|
||||||
/// @file glm/gtc/color_encoding.inl
|
/// @file glm/gtx/color_encoding.inl
|
||||||
|
|
||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
@ -13,16 +13,6 @@ namespace glm
|
|||||||
return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast<T>(5.650675255693055f);
|
return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast<T>(5.650675255693055f);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD65XYZToLinearSRGB(tvec3<T, P> const& ColorD65XYZ)
|
|
||||||
{
|
|
||||||
tvec3<T, P> const M(0.41847f, -0.091169f, 0.0009209f);
|
|
||||||
tvec3<T, P> const N(-0.15866f, 0.25243f, 0.015708f);
|
|
||||||
tvec3<T, P> const O(0.0009209f, -0.0025498f, 0.1786f);
|
|
||||||
|
|
||||||
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertLinearSRGBToD50XYZ(tvec3<T, P> const& ColorLinearSRGB)
|
GLM_FUNC_QUALIFIER tvec3<T, P> convertLinearSRGBToD50XYZ(tvec3<T, P> const& ColorLinearSRGB)
|
||||||
{
|
{
|
||||||
@ -34,13 +24,13 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD50XYZToLinearSRGB(tvec3<T, P> const& ColorD50XYZ)
|
GLM_FUNC_QUALIFIER tvec3<T, P> convertD65XYZToLinearSRGB(tvec3<T, P> const& ColorD65XYZ)
|
||||||
{
|
{
|
||||||
tvec3<T, P> const M();
|
tvec3<T, P> const M(0.41847f, -0.091169f, 0.0009209f);
|
||||||
tvec3<T, P> const N();
|
tvec3<T, P> const N(-0.15866f, 0.25243f, 0.015708f);
|
||||||
tvec3<T, P> const O();
|
tvec3<T, P> const O(0.0009209f, -0.0025498f, 0.1786f);
|
||||||
|
|
||||||
return M * ColorD50XYZ + N * ColorD50XYZ + O * ColorD50XYZ;
|
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
@ -53,13 +43,4 @@ namespace glm
|
|||||||
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD50XYZToD65XYZ(tvec3<T, P> const& ColorD50XYZ)
|
|
||||||
{
|
|
||||||
tvec3<T, P> const M();
|
|
||||||
tvec3<T, P> const N();
|
|
||||||
tvec3<T, P> const O();
|
|
||||||
|
|
||||||
return M * ColorD50XYZ + N * ColorD50XYZ + O * ColorD50XYZ;
|
|
||||||
}
|
|
||||||
}//namespace glm
|
}//namespace glm
|
@ -55,7 +55,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
|||||||
### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/latest) - 2017-XX-XX
|
### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/latest) - 2017-XX-XX
|
||||||
#### Features:
|
#### Features:
|
||||||
- Added RGBM encoding in GTC_packing #420
|
- Added RGBM encoding in GTC_packing #420
|
||||||
- Added GTC_color_encoding extension
|
- Added GTX_color_encoding extension
|
||||||
- Added GTX_vec_swizzle, faster compile time swizzling then swizzle operator #558
|
- Added GTX_vec_swizzle, faster compile time swizzling then swizzle operator #558
|
||||||
- Added [GLM_ENABLE_EXPERIMENTAL](manual.md#section7_4) to enable experimental features.
|
- Added [GLM_ENABLE_EXPERIMENTAL](manual.md#section7_4) to enable experimental features.
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
glmCreateTestGTC(gtc_bitfield)
|
glmCreateTestGTC(gtc_bitfield)
|
||||||
glmCreateTestGTC(gtc_color_encoding)
|
|
||||||
glmCreateTestGTC(gtc_color_space)
|
glmCreateTestGTC(gtc_color_space)
|
||||||
glmCreateTestGTC(gtc_constants)
|
glmCreateTestGTC(gtc_constants)
|
||||||
glmCreateTestGTC(gtc_epsilon)
|
glmCreateTestGTC(gtc_epsilon)
|
||||||
|
@ -174,13 +174,6 @@ int test_Snorm3x10_1x2()
|
|||||||
glm::uint32 p1 = glm::packSnorm3x10_1x2(v0);
|
glm::uint32 p1 = glm::packSnorm3x10_1x2(v0);
|
||||||
glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1);
|
glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
printf("Snorm3x10_1x2: p0: %x; v0: %3.2f, %3.2f, %3.2f, %3.2f; p1: %x; v1: %3.2f, %3.2f, %3.2f, %3.2f\n",
|
|
||||||
p0, v0.x, v0.y, v0.z, v0.w,
|
|
||||||
p1, v1.x, v1.y, v1.z, v1.w);
|
|
||||||
|
|
||||||
>>>>>>> 0.9.8
|
|
||||||
Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1;
|
Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,13 +199,6 @@ int test_Unorm3x10_1x2()
|
|||||||
glm::uint32 p1 = glm::packUnorm3x10_1x2(v0);
|
glm::uint32 p1 = glm::packUnorm3x10_1x2(v0);
|
||||||
glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1);
|
glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
printf("Unorm3x10_1x2: p0: %x; v0: %3.2f, %3.2f, %3.2f, %3.2f; p1: %x; v1: %3.2f, %3.2f, %3.2f, %3.2f\n",
|
|
||||||
p0, v0.x, v0.y, v0.z, v0.w,
|
|
||||||
p1, v1.x, v1.y, v1.z, v1.w);
|
|
||||||
|
|
||||||
>>>>>>> 0.9.8
|
|
||||||
Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1;
|
Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,10 +691,7 @@ int main()
|
|||||||
Error += test_F3x9_E1x5();
|
Error += test_F3x9_E1x5();
|
||||||
Error += test_RGBM();
|
Error += test_RGBM();
|
||||||
Error += test_Unorm3x10_1x2();
|
Error += test_Unorm3x10_1x2();
|
||||||
<<<<<<< HEAD
|
|
||||||
Error += test_Snorm3x10_1x2();
|
Error += test_Snorm3x10_1x2();
|
||||||
=======
|
|
||||||
>>>>>>> 0.9.8
|
|
||||||
|
|
||||||
Error += test_I3x10_1x2();
|
Error += test_I3x10_1x2();
|
||||||
Error += test_U3x10_1x2();
|
Error += test_U3x10_1x2();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
glmCreateTestGTC(gtx_associated_min_max)
|
glmCreateTestGTC(gtx_associated_min_max)
|
||||||
glmCreateTestGTC(gtx_closest_point)
|
glmCreateTestGTC(gtx_closest_point)
|
||||||
|
glmCreateTestGTC(gtx_color_encoding)
|
||||||
glmCreateTestGTC(gtx_color_space_YCoCg)
|
glmCreateTestGTC(gtx_color_space_YCoCg)
|
||||||
glmCreateTestGTC(gtx_color_space)
|
glmCreateTestGTC(gtx_color_space)
|
||||||
glmCreateTestGTC(gtx_common)
|
glmCreateTestGTC(gtx_common)
|
||||||
|
Loading…
Reference in New Issue
Block a user