33#include <NDEVR/Color.h>
34#include <NDEVR/Vector.h>
35#include <NDEVR/ObjectInfo.h>
44 class TranslatedString;
45 static const fltp04 inverse_255 = 1.0f/255.0f;
98 template<
class t_type>
102 template<
class t_type>
106 template<
class t_type>
110 template<
class t_type>
137 return m_values[channel] * inverse_255;
171 for(
uint04 dim = 0; dim < 4; ++dim)
198 static const bool Vector =
true;
199 static const uint01 Dimensions = 4;
201 static const bool Primitive =
true;
203 static const bool Pointer =
false;
204 static const bool Unsigned =
false;
205 static const bool Float =
false;
206 static const bool Integer =
false;
207 static const bool Number =
false;
208 static const bool Enum =
false;
209 static const bool String =
false;
210 static const bool Color =
true;
211 static const bool Buffer =
false;
212 static const bool Boolean =
false;
215 static_assert(
sizeof(RGBColor) == 4,
"Bad Color size");
221 template<
class t_type>
226 for (
uint01 dim = 0; dim < 3; ++dim)
235 for (
uint01 dim = 0; dim < 3; ++dim)
245 for (
uint01 dim = 0; dim < 3; ++dim)
250 static_assert(
sizeof(RGBColor) == 4,
"Bad color size");
ACI colors are the standard colors used in AutoCAD-based products. Each color is identified by an ACI...
Definition ACIColor.h:58
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
The core Color class in the NDEVR API. Colors can be defined in several ways. The ACIColor is compact...
Definition Color.h:41
The HSB (Hue, Saturation, Brightness) color model defines a color space in terms of three constituent...
Definition HSBColor.h:57
The HSL (Hue, Saturation, Luminosity) color model defines a color space in.
Definition HSLColor.h:47
A Lab color space is a color-opponent space with dimension L for luminance and a and b for the color-...
Definition LABColor.h:61
Provides shared ownership of a dynamically allocated object.
Definition Pointer.hpp:71
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
NDEVR_BASE_API RGBColor(const Vector< 2, fltp04 > &color)
RGBColor(const Vector< 4, t_type > &color)
Definition RGBColor.h:111
NDEVR_BASE_API RGBColor(const Vector< 3, fltp08 > &color)
NDEVR_BASE_API String getHexRGBA() const
fltp04 getF(uint01 channel) const
Definition RGBColor.h:135
RGBColor(const Vector< 3, t_type > &color)
Definition RGBColor.h:107
NDEVR_BASE_API RGBColor(const fltp08 r, const fltp08 g, const fltp08 b, const fltp08 a=1.0f)
NDEVR_BASE_API TranslatedString getName() const
constexpr RGBColor(const RGBColor &color)
Definition RGBColor.h:94
NDEVR_BASE_API RGBColor(const Vector< 4, fltp08 > &color)
RGBColor(uint04 value)
Definition RGBColor.h:65
size_t operator()() const
Definition RGBColor.h:165
NDEVR_BASE_API bool isLight() const
constexpr RGBColor()
Definition RGBColor.h:62
NDEVR_BASE_API RGBColor(const Vector< 2, fltp08 > &color)
NDEVR_BASE_API String getHexARGB() const
static const uint01 a_pos
Definition RGBColor.h:59
static NDEVR_BASE_API RGBColor CreateRGBA32BitColor(uint04 color_32)
NDEVR_BASE_API RGBColor(const Vector< 1, fltp08 > &color)
NDEVR_BASE_API RGBColor(const Vector< 1, fltp04 > &color)
static NDEVR_BASE_API RGBColor create24BitColor(uint04 color_24)
NDEVR_BASE_API RGBColor(const HSBColor &)
static NDEVR_BASE_API RGBColor Average(const RGBColor &a, const RGBColor &b, fltp04 percent=0.5f)
void setF(uint01 channel, fltp04 value)
Definition RGBColor.h:139
NDEVR_BASE_API RGBColor(const Vector< 3, fltp04 > &color)
static const uint01 r_pos
Definition RGBColor.h:56
NDEVR_BASE_API Vector< 3, fltp04 > get3F() const
NDEVR_BASE_API uint04 convertToRGBA32BitColor() const
NDEVR_BASE_API RGBColor(const fltp04 r, const fltp04 g, const fltp04 b, const fltp04 a=1.0f)
Constructor to initialize color using floating-point values for each channel.
NDEVR_BASE_API uint04 convertTo24BitColor() const
constexpr RGBColor & operator=(const RGBColor &color)
Definition RGBColor.h:169
NDEVR_BASE_API Vector< 4, fltp04 > get4F() const
NDEVR_BASE_API RGBColor contrastingColor() const
static const uint01 g_pos
Definition RGBColor.h:57
NDEVR_BASE_API String getHexRGB() const
RGBColor(const Vector< 1, t_type > &color)
Definition RGBColor.h:99
constexpr RGBColor(const uint01 r, const uint01 g, const uint01 b, const uint01 a=255)
Constructor to initialize color using integer values for each channel.
Definition RGBColor.h:82
constexpr RGBColor(const sint04 r, const sint04 g, const sint04 b, const sint04 a=255)
Definition RGBColor.h:68
NDEVR_BASE_API RGBColor(const XYZColor &)
NDEVR_BASE_API RGBColor(const ACIColor &)
RGBColor(const Vector< 2, t_type > &color)
Definition RGBColor.h:103
NDEVR_BASE_API RGBColor(const HSLColor &)
static const uint01 b_pos
Definition RGBColor.h:58
NDEVR_BASE_API RGBColor(const Vector< 4, fltp04 > &color)
NDEVR_BASE_API uint04 convertToABGR32BitColor() const
static NDEVR_BASE_API RGBColor Average(const RGBColor &a, const RGBColor &b, const RGBColor &c)
RGBColor opaque() const
Definition RGBColor.h:130
NDEVR_BASE_API RGBColor(const LABColor &)
NDEVR_BASE_API fltp04 luminance() const
Returns the luminance of the color.
static NDEVR_BASE_API RGBColor AverageLAB(const RGBColor &a, const RGBColor &b, fltp04 percent=0.5f)
static NDEVR_BASE_API RGBColor CreateARGB32BitColor(uint04 color_32)
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
uint01 m_values[t_dims]
Definition Vector.hpp:623
constexpr Vector< t_dims, t_new_type > as() const
Definition Vector.hpp:300
In opposition to the previous models, the CIE XYZ model defines an absolute color space....
Definition XYZColor.h:51
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
constexpr std::enable_if< IsVecType< t_vector_type, Angle< fltp08 > >::value, t_vector_type >::type operator*(const t_vector_type &angle, const t_type &mult)
Multiplication operator for a Vector of Angles.
Definition AngleFunctions.h:326
constexpr t_type clip(const t_type &value, const t_type &lower_bound, const t_type &upper_bound)
Clips the value given so that that the returned value falls between upper and lower bound.
Definition BaseFunctions.hpp:207
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
constexpr RGBColor & operator*=(RGBColor &color, const t_type &value)
Definition RGBColor.h:222
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Information about the object.
Definition ObjectInfo.h:54