color_space.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  16. # ifndef GLM_ENABLE_EXPERIMENTAL
  17. # pragma message("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.")
  18. # else
  19. # pragma message("GLM: GLM_GTX_color_space extension included")
  20. # endif
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_color_space
  25. /// @{
  26. /// Converts a color from HSV color space to its color in RGB color space.
  27. /// @see gtx_color_space
  28. template<typename T, qualifier Q>
  29. GLM_FUNC_DECL vec<3, T, Q> rgbColor(
  30. vec<3, T, Q> const& hsvValue);
  31. /// Converts a color from RGB color space to its color in HSV color space.
  32. /// @see gtx_color_space
  33. template<typename T, qualifier Q>
  34. GLM_FUNC_DECL vec<3, T, Q> hsvColor(
  35. vec<3, T, Q> const& rgbValue);
  36. /// Build a saturation matrix.
  37. /// @see gtx_color_space
  38. template<typename T>
  39. GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation(
  40. T const s);
  41. /// Modify the saturation of a color.
  42. /// @see gtx_color_space
  43. template<typename T, qualifier Q>
  44. GLM_FUNC_DECL vec<3, T, Q> saturation(
  45. T const s,
  46. vec<3, T, Q> const& color);
  47. /// Modify the saturation of a color.
  48. /// @see gtx_color_space
  49. template<typename T, qualifier Q>
  50. GLM_FUNC_DECL vec<4, T, Q> saturation(
  51. T const s,
  52. vec<4, T, Q> const& color);
  53. /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
  54. /// @see gtx_color_space
  55. template<typename T, qualifier Q>
  56. GLM_FUNC_DECL T luminosity(
  57. vec<3, T, Q> const& color);
  58. /// @}
  59. }//namespace glm
  60. #include "color_space.inl"