NDEVR
API Documentation
LABColor.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: LABColor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Color.h>
34#include <NDEVR/Vector.h>
35#include <NDEVR/Buffer.h>
36namespace NDEVR
37{
38 class XYZColor;
39 class ACIColor;
40 class HSBColor;
41 class RGBColor;
42 class String;
43 class TranslatedString;
64 class LABColor : public Vector<4, fltp04>, public Color
65 {
66 public:
70 constexpr LABColor()
71 {}
72
79 constexpr LABColor(fltp04 x, fltp04 y, fltp04 z, fltp04 a = 1.0f)
80 : Vector<4, fltp04>(x, y, z, a)
81 {}
82
86 constexpr LABColor(const Vector<4, fltp04>& lab)
87 : Vector<4, fltp04>(lab)
88 {}
89
93 NDEVR_BASE_API explicit LABColor(const XYZColor& lab);
98 NDEVR_BASE_API explicit LABColor(const ACIColor& lab);
103 NDEVR_BASE_API explicit LABColor(const HSBColor& lab);
108 NDEVR_BASE_API explicit LABColor(const RGBColor& lab);
109#if NDEVR_INCLUDE_RAL_COLORS
114 NDEVR_BASE_API static const AlocatingAlignedBuffer<std::pair<LABColor, TranslatedString>, 64>& RALClassicColors();
119 NDEVR_BASE_API const TranslatedString& getName() const;
120#endif
121 };
122 static_assert(sizeof(LABColor) == 16, "Bad color size");
123 template<> constexpr LABColor Constant<LABColor>::Invalid = LABColor(Constant<fltp04>::Invalid, Constant<fltp04>::Invalid, Constant<fltp04>::Invalid);
124 template<> constexpr LABColor Constant<LABColor>::Max = LABColor(Constant<fltp04>::Max, Constant<fltp04>::Max, Constant<fltp04>::Max);
125 template<> constexpr LABColor Constant<LABColor>::Min = LABColor(Constant<fltp04>::Min, Constant<fltp04>::Min, Constant<fltp04>::Min);
126}
127
A color identified by an AutoCAD Color Index (ACI) number from 1 through 255.
Definition ACIColor.h:59
The core Color class in the NDEVR API.
Definition Color.h:42
A color defined by hue, saturation, and brightness components.
Definition HSBColor.h:62
Forward declaration of the NDEVR translated string class.
Definition LABColor.h:65
LABColor(const HSBColor &lab)
Constructs a LABColor by converting from an HSB color.
constexpr LABColor()
Default constructor.
Definition LABColor.h:70
LABColor(const ACIColor &lab)
Constructs a LABColor by converting from an AutoCAD Color Index color.
LABColor(const XYZColor &lab)
Constructs a LABColor by converting from a CIE XYZ color.
constexpr LABColor(fltp04 x, fltp04 y, fltp04 z, fltp04 a=1.0f)
Constructs a LABColor from individual L*, a*, b*, and alpha components.
Definition LABColor.h:79
LABColor(const RGBColor &lab)
Constructs a LABColor by converting from an RGB color.
constexpr LABColor(const Vector< 4, fltp04 > &lab)
Constructs a LABColor from a 4-component vector.
Definition LABColor.h:86
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Forward declaration of HSLColor.
Definition XYZColor.h:55
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...