color_space.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /// @ref gtc_color_space
  2. /// @file glm/gtc/color_space.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtc_color_space (dependence)
  6. ///
  7. /// @defgroup gtc_color_space GLM_GTC_color_space
  8. /// @ingroup gtc
  9. ///
  10. /// Include <glm/gtc/color_space.hpp> to use the features of this extension.
  11. ///
  12. /// Allow to perform bit operations on integer values
  13. #pragma once
  14. // Dependencies
  15. #include "../detail/setup.hpp"
  16. #include "../detail/qualifier.hpp"
  17. #include "../exponential.hpp"
  18. #include "../vec3.hpp"
  19. #include "../vec4.hpp"
  20. #include <limits>
  21. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  22. # pragma message("GLM: GLM_GTC_color_space extension included")
  23. #endif
  24. namespace glm
  25. {
  26. /// @addtogroup gtc_color_space
  27. /// @{
  28. /// Convert a linear color to sRGB color using a standard gamma correction.
  29. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
  30. template<length_t L, typename T, qualifier Q>
  31. GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear);
  32. /// Convert a linear color to sRGB color using a custom gamma correction.
  33. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
  34. template<length_t L, typename T, qualifier Q>
  35. GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear, T Gamma);
  36. /// Convert a sRGB color to linear color using a standard gamma correction.
  37. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
  38. template<length_t L, typename T, qualifier Q>
  39. GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB);
  40. /// Convert a sRGB color to linear color using a custom gamma correction.
  41. // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
  42. template<length_t L, typename T, qualifier Q>
  43. GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB, T Gamma);
  44. /// @}
  45. } //namespace glm
  46. #include "color_space.inl"