![]() |
NDEVR
API Documentation
|
A color defined by hue, saturation, and brightness components. More...
Public Member Functions | |
| HSBColor () | |
| Default constructor. | |
| HSBColor (const ACIColor &) | |
| Constructs an HSBColor by converting from an ACIColor. | |
| constexpr | HSBColor (const Angle< HSBAngleType > &h, fltp04 s, fltp04 b, fltp04 a=1.0f) |
| Constructs an HSBColor from single-precision floating-point values. | |
| constexpr | HSBColor (const Angle< HSBAngleType > &h, fltp08 s, fltp08 b, fltp08 a=1.0) |
| Constructs an HSBColor from double-precision floating-point values. | |
| constexpr | HSBColor (const Angle< HSBAngleType > &h, uint01 s, uint01 b, uint01 a=255) |
| Constructs an HSBColor from integer component values. | |
| HSBColor (const RGBColor &) | |
| Constructs an HSBColor by converting from an RGBColor. | |
| HSBColor (const Vector< 4, fltp04 > &color) | |
| Constructs an HSBColor from a 4-component floating-point vector. | |
| HSBColor (const XYZColor &) | |
| Constructs an HSBColor by converting from an XYZColor. | |
| constexpr | HSBColor (fltp04 h, fltp04 s, fltp04 b, fltp04 a=1.0f) |
| Constructs an HSBColor from raw single-precision values with hue in degrees. | |
| constexpr | HSBColor (fltp08 h, fltp08 s, fltp08 b, fltp08 a=1.0f) |
| Constructs an HSBColor from raw double-precision values with hue in degrees. | |
| fltp04 | getAF () const |
| Gets the alpha as a normalized float (0.0-1.0). | |
| fltp04 | getBF () const |
| Gets the brightness as a normalized float (0.0-1.0). | |
| fltp04 | getBS () const |
| Gets the saturation as a normalized float (0.0-1.0). | |
| template<class t_type> | |
| t_type | getHDeg () const |
| Gets the hue component in degrees, cast to the requested type. | |
| bool | operator!= (const HSBColor &color) const |
| Checks inequality between two HSBColor instances. | |
| bool | operator== (const HSBColor &color) const |
| Checks equality between two HSBColor instances. | |
| template<class t_type> | |
| void | setHDeg (const t_type &val) |
| Sets the hue component from a value in degrees. | |
Static Public Member Functions | |
| static HSBColor | ConvertColor (const LABColor ¤t_color, const PrimitiveAlignedBuffer< std::pair< LABColor, LABColor >, 32 > &pairs, bool preserve_brightness, bool preserve_alpha) |
| Converts a LABColor to an HSBColor using a set of LAB color mapping pairs. | |
Public Attributes | |
| uint01 | alpha |
| The alpha (opacity) component, ranging from 0 (transparent) to 255 (opaque). | |
| uint01 | brightness |
| The brightness component, ranging from 0 to 255. | |
| Angle< HSBAngleType > | hue |
| The hue component as an angle, ranging from 0 to 360 degrees. | |
| uint01 | saturation |
| The saturation component, ranging from 0 to 255. | |
A color defined by hue, saturation, and brightness components.
The HSB (Hue, Saturation, Brightness) color model defines a color space in terms of three constituent components hue, brightness and brightness
Hue: the color type (such as red, blue, or yellow). Ranges from 0 to 360 (each value corresponds to one color: 0 is red, 45 is a shade of orange and 55 is a shade of yellow).
Saturation: the saturation of the color.
Brightness: the brightness of the color. Ranges from 0 to 100% (0 is always black; depending on the saturation, 100 may be white or a more or less saturated color).
Definition at line 61 of file HSBColor.h.
|
inline |
Default constructor.
Leaves all components uninitialized.
Definition at line 72 of file HSBColor.h.
Referenced by ConvertColor(), operator!=(), and operator==().
|
inlineconstexpr |
Constructs an HSBColor from integer component values.
| [in] | h | The hue as an angle. |
| [in] | s | The saturation as a uint01 value (0-255). |
| [in] | b | The brightness as a uint01 value (0-255). |
| [in] | a | The alpha as a uint01 value (0-255), defaults to 255 (fully opaque). |
Definition at line 81 of file HSBColor.h.
References alpha, brightness, hue, and saturation.
|
inlineconstexpr |
Constructs an HSBColor from double-precision floating-point values.
| [in] | h | The hue as an angle. |
| [in] | s | The saturation as a normalized double (0.0-1.0), clamped to range. |
| [in] | b | The brightness as a normalized double (0.0-1.0), clamped to range. |
| [in] | a | The alpha as a normalized double (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 95 of file HSBColor.h.
References alpha, brightness, cast(), hue, and saturation.
|
inlineconstexpr |
Constructs an HSBColor from single-precision floating-point values.
| [in] | h | The hue as an angle. |
| [in] | s | The saturation as a normalized float (0.0-1.0), clamped to range. |
| [in] | b | The brightness as a normalized float (0.0-1.0), clamped to range. |
| [in] | a | The alpha as a normalized float (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 109 of file HSBColor.h.
References alpha, brightness, cast(), hue, and saturation.
Constructs an HSBColor from raw double-precision values with hue in degrees.
| [in] | h | The hue in degrees (0.0-360.0). |
| [in] | s | The saturation as a normalized double (0.0-1.0), clamped to range. |
| [in] | b | The brightness as a normalized double (0.0-1.0), clamped to range. |
| [in] | a | The alpha as a normalized double (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 123 of file HSBColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
Constructs an HSBColor from raw single-precision values with hue in degrees.
| [in] | h | The hue in degrees (0.0-360.0). |
| [in] | s | The saturation as a normalized float (0.0-1.0), clamped to range. |
| [in] | b | The brightness as a normalized float (0.0-1.0), clamped to range. |
| [in] | a | The alpha as a normalized float (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 137 of file HSBColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
Constructs an HSBColor from a 4-component floating-point vector.
| [in] | color | A vector containing hue, saturation, brightness, and alpha components. |
|
explicit |
|
explicit |
|
explicit |
|
static |
Converts a LABColor to an HSBColor using a set of LAB color mapping pairs.
| [in] | current_color | The LABColor to convert. |
| [in] | pairs | A buffer of LABColor pairs defining the source-to-target color mapping. |
| [in] | preserve_brightness | Whether to preserve the original brightness during conversion. |
| [in] | preserve_alpha | Whether to preserve the original alpha during conversion. |
References HSBColor().
|
inline |
Gets the alpha as a normalized float (0.0-1.0).
Definition at line 201 of file HSBColor.h.
|
inline |
Gets the brightness as a normalized float (0.0-1.0).
Definition at line 185 of file HSBColor.h.
References brightness, and cast().
|
inline |
Gets the saturation as a normalized float (0.0-1.0).
Definition at line 193 of file HSBColor.h.
References cast(), and saturation.
|
inline |
Gets the hue component in degrees, cast to the requested type.
Definition at line 168 of file HSBColor.h.
|
inline |
Checks inequality between two HSBColor instances.
| [in] | color | The color to compare against. |
Definition at line 222 of file HSBColor.h.
References HSBColor(), alpha, brightness, hue, and saturation.
|
inline |
Checks equality between two HSBColor instances.
| [in] | color | The color to compare against. |
Definition at line 210 of file HSBColor.h.
References HSBColor(), alpha, brightness, hue, and saturation.
|
inline |
Sets the hue component from a value in degrees.
| [in] | val | The hue angle in degrees. |
Definition at line 177 of file HSBColor.h.