summaryrefslogtreecommitdiff
path: root/src/glm/gtx/color_space.hpp
blob: 03052f517bdca02ff980a138387f2ab745b95694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2007-02-22
// Licence : This source is under MIT License
// File    : glm/gtx/color_space.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_color_space
#define glm_gtx_color_space

// Dependency:
#include "../glm.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_color_space extension included")
#endif

namespace glm{
namespace gtx{
namespace color_space ///< GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations
{
	/// \addtogroup gtx_color_space
	/// @{

	//! Converts a color from HSV color space to its color in RGB color space.
	//! From GLM_GTX_color_space extension.
    template <typename valType> 
	detail::tvec3<valType> rgbColor(
		detail::tvec3<valType> const & hsvValue);

	//! Converts a color from RGB color space to its color in HSV color space.
	//! From GLM_GTX_color_space extension.
    template <typename valType> 
	detail::tvec3<valType> hsvColor(
		detail::tvec3<valType> const & rgbValue);
		
	//! Build a saturation matrix.
	//! From GLM_GTX_color_space extension
    template <typename valType> 
	detail::tmat4x4<valType> saturation(
		valType const s);

    //! Modify the saturation of a color.
	//! From GLM_GTX_color_space extension.
	template <typename valType> 
	detail::tvec3<valType> saturation(
		valType const s, 
		detail::tvec3<valType> const & color);
		
	//! Modify the saturation of a color.
	//! From GLM_GTX_color_space extension.
    template <typename valType> 
	detail::tvec4<valType> saturation(
		valType const s, 
		detail::tvec4<valType> const & color);
		
	//! Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
	//! From GLM_GTX_color_space extension.
	template <typename valType> 
	valType luminosity(
		detail::tvec3<valType> const & color);

	/// @}
}//namespace color_space
}//namespace gtx
}//namespace glm

#include "color_space.inl"

namespace glm{using namespace gtx::color_space;}

#endif//glm_gtx_color_space