From 5437d49cf28500986792db5b5157eef8e1aebc21 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 1 Aug 2015 21:55:28 +0200 Subject: [PATCH] Renamed GTC_color to GTC_color_space --- glm/gtc/{color.hpp => color_space.hpp} | 32 +++++++++---------- glm/gtc/{color.inl => color_space.inl} | 18 +++++------ readme.md | 10 ++---- test/gtc/CMakeLists.txt | 2 +- .../{gtc_color.cpp => gtc_color_space.cpp} | 18 +++++------ 5 files changed, 38 insertions(+), 42 deletions(-) rename glm/gtc/{color.hpp => color_space.hpp} (71%) rename glm/gtc/{color.inl => color_space.inl} (85%) rename test/gtc/{gtc_color.cpp => gtc_color_space.cpp} (78%) diff --git a/glm/gtc/color.hpp b/glm/gtc/color_space.hpp similarity index 71% rename from glm/gtc/color.hpp rename to glm/gtc/color_space.hpp index e685cf4f..8a35a4e6 100644 --- a/glm/gtc/color.hpp +++ b/glm/gtc/color_space.hpp @@ -24,15 +24,15 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// -/// @ref gtc_color -/// @file glm/gtc/color.hpp -/// @date 2015-02-10 / 2015-02-10 +/// @ref gtc_color_space +/// @file glm/gtc/color_space.hpp +/// @date 2015-02-10 / 2015-08-02 /// @author Christophe Riccio /// /// @see core (dependence) -/// @see gtc_color (dependence) +/// @see gtc_color_space (dependence) /// -/// @defgroup gtc_color GLM_GTC_color +/// @defgroup gtc_color_space GLM_GTC_color_space /// @ingroup gtc /// /// @brief Allow to perform bit operations on integer values @@ -51,31 +51,31 @@ #include #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_color extension included") +# pragma message("GLM: GLM_GTC_color_space extension included") #endif namespace glm { - /// @addtogroup gtc_color + /// @addtogroup gtc_color_space /// @{ - /// Convert a RGB color to sRGB color using a standard gamma correction + /// Convert a linear color to sRGB color using a standard gamma correction template class vecType> - GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB); + GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear); - /// Convert a RGB color to sRGB color using a custom gamma correction + /// Convert a linear color to sRGB color using a custom gamma correction template class vecType> - GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma); + GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma); - /// Convert a sRGB color to RGB color using a standard gamma correction + /// Convert a sRGB color to linear color using a standard gamma correction template class vecType> - GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB); + GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB); - /// Convert a sRGB color to RGB color using a custom gamma correction + /// Convert a sRGB color to linear color using a custom gamma correction template class vecType> - GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB, T Gamma); + GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma); /// @} } //namespace glm -#include "color.inl" +#include "color_space.inl" diff --git a/glm/gtc/color.inl b/glm/gtc/color_space.inl similarity index 85% rename from glm/gtc/color.inl rename to glm/gtc/color_space.inl index 8d127fa1..3561045d 100644 --- a/glm/gtc/color.inl +++ b/glm/gtc/color_space.inl @@ -24,9 +24,9 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// -/// @ref gtc_color -/// @file glm/gtc/color.inl -/// @date 2015-02-10 / 2015-02-10 +/// @ref gtc_color_space +/// @file glm/gtc/color_space.inl +/// @date 2015-02-10 / 2015-08-02 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -79,25 +79,25 @@ namespace detail }//namespace detail template class vecType> - GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB) + GLM_FUNC_QUALIFIER vecType convertLinearToSRGB(vecType const & ColorLinear) { - return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(0.41666)); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma) + GLM_FUNC_QUALIFIER vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma) { - return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(1) / Gamma); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertSrgbToRgb(vecType const & ColorSRGB) + GLM_FUNC_QUALIFIER vecType convertSRGBToLinear(vecType const & ColorSRGB) { return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertSrgbToRgb(vecType const & ColorSRGB, T Gamma) + GLM_FUNC_QUALIFIER vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma) { return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); } diff --git a/readme.md b/readme.md index 32b4264a..66cbc87f 100644 --- a/readme.md +++ b/readme.md @@ -50,9 +50,9 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes -#### GLM 0.9.7.0 - 2015-XX-XX +#### GLM 0.9.7.0 - 2015-08-02 ##### Features: -- Added GTC_color: convertRgbToSrgb and convertSrgbToRgb functions +- Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions - Added 'fmod' overload to GTX_common with tests #308 - Left handed perspective and lookAt functions #314 - Added functions eulerAngleXYZ and extractEulerAngleXYZ #311 @@ -71,6 +71,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Updated list of compiler versions ##### Fixes: +- Fixed default precision for quat and dual_quat type #312 - Fixed (u)int64 MSB/LSB handling on BE archs #306 - Fixed multi-line comment warning in g++. #315 - Fixed specifier removal by 'std::make_pair<>' #333 @@ -87,11 +88,6 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Removed integer specification for 'mod' in GTC_integer #308 - Removed GTX_multiple, replaced by GTC_round --------------------------------------------------------------------------------- -#### GLM 0.9.6.4 - 2015-0X-XX -##### Fixes: -- Fixed default precision for quat and dual_quat type #312 - -------------------------------------------------------------------------------- #### [GLM 0.9.6.3 - 2015-02-15](https://github.com/g-truc/glm/releases/tag/0.9.6.3) - Fixed Android doesn't have C++ 11 STL #284 diff --git a/test/gtc/CMakeLists.txt b/test/gtc/CMakeLists.txt index f7ea5779..18bc2494 100644 --- a/test/gtc/CMakeLists.txt +++ b/test/gtc/CMakeLists.txt @@ -1,5 +1,5 @@ glmCreateTestGTC(gtc_bitfield) -glmCreateTestGTC(gtc_color) +glmCreateTestGTC(gtc_color_space) glmCreateTestGTC(gtc_constants) glmCreateTestGTC(gtc_epsilon) glmCreateTestGTC(gtc_integer) diff --git a/test/gtc/gtc_color.cpp b/test/gtc/gtc_color_space.cpp similarity index 78% rename from test/gtc/gtc_color.cpp rename to test/gtc/gtc_color_space.cpp index 03bd0261..fb585cc6 100644 --- a/test/gtc/gtc_color.cpp +++ b/test/gtc/gtc_color_space.cpp @@ -29,7 +29,7 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include @@ -42,28 +42,28 @@ namespace srgb glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0); { - glm::vec3 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB); - glm::vec3 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB); + glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB); + glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; } { - glm::vec3 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGB, 2.8f); - glm::vec3 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB, 2.8f); + glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f); + glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; } glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0); { - glm::vec4 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGBA); - glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB); + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; } { - glm::vec4 const ColorSRGB = glm::convertRgbToSrgb(ColorSourceRGBA, 2.8f); - glm::vec4 const ColorRGB = glm::convertSrgbToRgb(ColorSRGB, 2.8f); + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; }