color_space.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /// @ref gtx_color_space
  2. /// @file glm/gtx/color_space.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_color_space GLM_GTX_color_space
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/color_space.hpp> to use the features of this extension.
  10. ///
  11. /// Related to RGB to HSV conversions and operations.
  12. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #ifndef GLM_ENABLE_EXPERIMENTAL
  16. # error "GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  17. #endif
  18. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_color_space extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_color_space
  24. /// @{
  25. /// Converts a color from HSV color space to its color in RGB color space.
  26. /// @see gtx_color_space
  27. template<typename T, qualifier Q>
  28. GLM_FUNC_DECL vec<3, T, Q> rgbColor(
  29. vec<3, T, Q> const& hsvValue);
  30. /// Converts a color from RGB color space to its color in HSV color space.
  31. /// @see gtx_color_space
  32. template<typename T, qualifier Q>
  33. GLM_FUNC_DECL vec<3, T, Q> hsvColor(
  34. vec<3, T, Q> const& rgbValue);
  35. /// Build a saturation matrix.
  36. /// @see gtx_color_space
  37. template<typename T>
  38. GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation(
  39. T const s);
  40. /// Modify the saturation of a color.
  41. /// @see gtx_color_space
  42. template<typename T, qualifier Q>
  43. GLM_FUNC_DECL vec<3, T, Q> saturation(
  44. T const s,
  45. vec<3, T, Q> const& color);
  46. /// Modify the saturation of a color.
  47. /// @see gtx_color_space
  48. template<typename T, qualifier Q>
  49. GLM_FUNC_DECL vec<4, T, Q> saturation(
  50. T const s,
  51. vec<4, T, Q> const& color);
  52. /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
  53. /// @see gtx_color_space
  54. template<typename T, qualifier Q>
  55. GLM_FUNC_DECL T luminosity(
  56. vec<3, T, Q> const& color);
  57. /// @}
  58. }//namespace glm
  59. #include "color_space.inl"