33#include <NDEVR/Color.h>
34#include <NDEVR/Angle.h>
35#include <NDEVR/Vector.h>
183 template<
class t_type>
192 template<
class t_type>
A color identified by an AutoCAD Color Index (ACI) number from 1 through 255.
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
static constexpr sint04 INDEX_PI
Optimized angle constant representing PI; allows integers to store angles to some degree of accuracy.
The core Color class in the NDEVR API.
A color defined by hue, saturation, and luminosity components.
constexpr HSLColor(const Angle< HSLAngleType > &h, uint01 s, uint01 b, uint01 a=255)
Constructs an HSLColor from an angle and integer components.
Angle< HSLAngleType > hue
The hue component, representing the color angle on the color wheel.
constexpr HSLColor(const Vector< 4, fltp04 > &color)
Constructs an HSLColor from a 4-component float vector (hue degrees, saturation, brightness,...
constexpr HSLColor()
Constructs a default HSLColor with all components set to invalid.
void setHI(uint01 val)
Sets the hue component from a uint01 index in the range 0-255.
fltp04 getAF() const
Gets the alpha component as a normalized float (0.0-1.0).
constexpr HSLColor(const Angle< HSLAngleType > &h, fltp08 s, fltp08 b, fltp08 a=1.0)
Constructs an HSLColor from an angle and double-precision floating-point components.
HSLColor(const XYZColor &)
Constructs an HSLColor by converting from an XYZColor.
uint01 brightness
The brightness (luminosity) component, stored as 0-255.
constexpr HSLColor(fltp04 h, fltp04 s, fltp04 b, fltp04 a=1.0f)
Constructs an HSLColor from single-precision hue in degrees and normalized components.
constexpr HSLColor(const Angle< HSLAngleType > &h, fltp04 s, fltp04 b, fltp04 a=1.0f)
Constructs an HSLColor from an angle and single-precision floating-point components.
void setHDeg(const t_type &val)
Sets the hue component from a value in degrees.
HSLColor(const ACIColor &)
Constructs an HSLColor by converting from an ACIColor.
uint01 getHI() const
Gets the hue component as a uint01 index in the range 0-255.
uint01 saturation
The saturation component, stored as 0-255.
constexpr HSLColor(const HSLColor &color)=default
Copy constructor.
constexpr HSLColor(uint01 h, uint01 s, uint01 b, uint01 a=255)
Constructs an HSLColor from integer components, converting hue from a 0-255 range to degrees.
uint01 alpha
The alpha (opacity) component, stored as 0-255.
t_type getHDeg() const
Gets the hue component in degrees, converted to the specified type.
constexpr HSLColor(fltp08 h, fltp08 s, fltp08 b, fltp08 a=1.0f)
Constructs an HSLColor from double-precision hue in degrees and normalized components.
HSLColor(const RGBColor &)
Constructs an HSLColor by converting from an RGBColor.
bool operator!=(const HSLColor &color) const
Checks inequality between two HSLColor values.
fltp04 getBF() const
Gets the brightness component as a normalized float (0.0-1.0).
bool operator==(const HSLColor &color) const
Checks equality between two HSLColor values.
fltp04 getSF() const
Gets the saturation component as a normalized float (0.0-1.0).
Represents a color in the RGB space with optional alpha transparency.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Forward declaration of HSLColor.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
double fltp08
Defines an alias representing an 8 byte floating-point number.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
@ DEGREES
Angle measured in degrees (0 to 360 for a full circle).
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
sint04 HSLAngleType
The integer type used for HSL hue angle representation.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...