Update HslTransform.h

Former-commit-id: 634544dbb41949a55591f5b41ef956588c5c7946
This commit is contained in:
AEtHeLsYn 2015-12-22 09:58:49 +01:00
parent e6fe6e5bc7
commit 2eabc34f09

View File

@ -4,7 +4,7 @@
#include <cstdint> #include <cstdint>
/// ///
/// Color transformation to adjust the saturation and value of a RGB color value /// Color transformation to adjust the saturation and luminance of a RGB color value
/// ///
class HslTransform class HslTransform
{ {
@ -76,33 +76,25 @@ public:
/// @param[out] saturation The saturation HSL-component /// @param[out] saturation The saturation HSL-component
/// @param[out] luminance The luminance HSL-component /// @param[out] luminance The luminance HSL-component
/// ///
/// @note Integer version of the conversion are faster, but a little less accurate all values
/// are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit
/// number and scaled between 0 and 360
///
static void rgb2hsl(uint8_t red, uint8_t green, uint8_t blue, uint16_t & hue, float & saturation, float & luminance); static void rgb2hsl(uint8_t red, uint8_t green, uint8_t blue, uint16_t & hue, float & saturation, float & luminance);
/// ///
/// Translates an HSL (hue, saturation, luminance) color to an RGB (red, green, blue) color /// Translates an HSL (hue, saturation, luminance) color to an RGB (red, green, blue) color
/// ///
/// @param[in] hue The hue HSV-component /// @param[in] hue The hue HSL-component
/// @param[in] saturation The saturation HSV-component /// @param[in] saturation The saturation HSL-component
/// @param[in] luminance The luminance HSL-component /// @param[in] luminance The luminance HSL-component
/// @param[out] red The red RGB-component /// @param[out] red The red RGB-component
/// @param[out] green The green RGB-component /// @param[out] green The green RGB-component
/// @param[out] blue The blue RGB-component /// @param[out] blue The blue RGB-component
/// ///
/// @note Integer version of the conversion are faster, but a little less accurate all values
/// are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit
/// number and scaled between 0 and 360
///
static void hsl2rgb(uint16_t hue, float saturation, float luminance, uint8_t & red, uint8_t & green, uint8_t & blue); static void hsl2rgb(uint16_t hue, float saturation, float luminance, uint8_t & red, uint8_t & green, uint8_t & blue);
private: private:
/// The saturation gain /// The saturation gain
double _saturationGain; double _saturationGain;
/// The value gain /// The luminance gain
double _luminanceGain; double _luminanceGain;
/// aux function
float hue2rgb(float p, float q, float t);
}; };