• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /// @brief Related to RGB to HSV conversions and operations.
10 ///
11 /// <glm/gtx/color_space.hpp> need to be included to use these functionalities.
12 
13 #pragma once
14 
15 // Dependency:
16 #include "../glm.hpp"
17 
18 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
19 #	pragma message("GLM: GLM_GTX_color_space extension included")
20 #endif
21 
22 namespace glm
23 {
24 	/// @addtogroup gtx_color_space
25 	/// @{
26 
27 	/// Converts a color from HSV color space to its color in RGB color space.
28 	/// @see gtx_color_space
29 	template <typename T, precision P>
30 	GLM_FUNC_DECL tvec3<T, P> rgbColor(
31 		tvec3<T, P> const & hsvValue);
32 
33 	/// Converts a color from RGB color space to its color in HSV color space.
34 	/// @see gtx_color_space
35 	template <typename T, precision P>
36 	GLM_FUNC_DECL tvec3<T, P> hsvColor(
37 		tvec3<T, P> const & rgbValue);
38 
39 	/// Build a saturation matrix.
40 	/// @see gtx_color_space
41 	template <typename T>
42 	GLM_FUNC_DECL tmat4x4<T, defaultp> saturation(
43 		T const s);
44 
45 	/// Modify the saturation of a color.
46 	/// @see gtx_color_space
47 	template <typename T, precision P>
48 	GLM_FUNC_DECL tvec3<T, P> saturation(
49 		T const s,
50 		tvec3<T, P> const & color);
51 
52 	/// Modify the saturation of a color.
53 	/// @see gtx_color_space
54 	template <typename T, precision P>
55 	GLM_FUNC_DECL tvec4<T, P> saturation(
56 		T const s,
57 		tvec4<T, P> const & color);
58 
59 	/// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
60 	/// @see gtx_color_space
61 	template <typename T, precision P>
62 	GLM_FUNC_DECL T luminosity(
63 		tvec3<T, P> const & color);
64 
65 	/// @}
66 }//namespace glm
67 
68 #include "color_space.inl"
69