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 /// @brief Allow to perform bit operations on integer values 11 /// 12 /// <glm/gtc/color.hpp> need to be included to use these functionalities. 13 14 #pragma once 15 16 // Dependencies 17 #include "../detail/setup.hpp" 18 #include "../detail/precision.hpp" 19 #include "../exponential.hpp" 20 #include "../vec3.hpp" 21 #include "../vec4.hpp" 22 #include <limits> 23 24 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 25 # pragma message("GLM: GLM_GTC_color_space extension included") 26 #endif 27 28 namespace glm 29 { 30 /// @addtogroup gtc_color_space 31 /// @{ 32 33 /// Convert a linear color to sRGB color using a standard gamma correction. 34 /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 35 template <typename T, precision P, template <typename, precision> class vecType> 36 GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear); 37 38 /// Convert a linear color to sRGB color using a custom gamma correction. 39 /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 40 template <typename T, precision P, template <typename, precision> class vecType> 41 GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma); 42 43 /// Convert a sRGB color to linear color using a standard gamma correction. 44 /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 45 template <typename T, precision P, template <typename, precision> class vecType> 46 GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB); 47 48 /// Convert a sRGB color to linear color using a custom gamma correction. 49 // IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 50 template <typename T, precision P, template <typename, precision> class vecType> 51 GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma); 52 53 /// @} 54 } //namespace glm 55 56 #include "color_space.inl" 57