NDEVR
API Documentation
ACIColor.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: ACIColor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Color.h>
35#include <NDEVR/BaseValues.h>
36namespace NDEVR
37{
38 class String;
39 class TranslatedString;
40 class RGBColor;
41 class HSBColor;
42 class XYZColor;
43 class HSLColor;
44 class LABColor;
45
58 class ACIColor : public Color
59 {
60 public:
65 : m_index(0)
66 {}
67
71 constexpr explicit ACIColor(uint01 color)
72 : m_index(color)
73 {};
74
78 NDEVR_BASE_API explicit ACIColor(const RGBColor&);
83 NDEVR_BASE_API explicit ACIColor(const HSBColor&);
88 NDEVR_BASE_API explicit ACIColor(const HSLColor&);
93 NDEVR_BASE_API explicit ACIColor(const XYZColor&);
98 NDEVR_BASE_API explicit ACIColor(const LABColor&);
99
104 NDEVR_BASE_API RGBColor getRBGAColor() const;
109 NDEVR_BASE_API TranslatedString getName() const;
110
115 uint01 getIndex() const { return m_index; }
116
117 static const uint01 ASI_BLACK = 0;
118 static const uint01 ASI_RED = 1;
119 static const uint01 ASI_YELLOW = 2;
120 static const uint01 ASI_GREEN = 3;
121 static const uint01 ASI_TEAL = 4;
122 static const uint01 ASI_BLUE = 5;
123 static const uint01 ASI_PURPLE = 6;
124 static const uint01 ASI_WHITE = 7;
125 private:
126 uint01 m_index;
127 static const RGBColor CAD_INDEX[];
128 };
129 template<>
130 constexpr const ACIColor Constant<ACIColor>::Invalid = ACIColor(7);
131 template<>
132 constexpr const ACIColor Constant<ACIColor>::Max = ACIColor(255);
133 template<>
134 constexpr const ACIColor Constant<ACIColor>::Min = ACIColor(7);//Duplicate white seems silly so we will reserve this value
135}
136
137
A color identified by an AutoCAD Color Index (ACI) number from 1 through 255.
Definition ACIColor.h:59
RGBColor getRBGAColor() const
Converts this ACI color to its RGBA color representation.
static const uint01 ASI_GREEN
ACI index for green.
Definition ACIColor.h:120
static const uint01 ASI_WHITE
ACI index for white.
Definition ACIColor.h:124
static const uint01 ASI_TEAL
ACI index for teal (cyan).
Definition ACIColor.h:121
static const uint01 ASI_PURPLE
ACI index for purple (magenta).
Definition ACIColor.h:123
uint01 getIndex() const
Gets the raw ACI index value.
Definition ACIColor.h:115
ACIColor(const XYZColor &)
Constructs an ACIColor by finding the closest ACI match to an XYZ color.
constexpr ACIColor(uint01 color)
Constructs an ACIColor from the given ACI index value.
Definition ACIColor.h:71
ACIColor(const LABColor &)
Constructs an ACIColor by finding the closest ACI match to a LAB color.
ACIColor()
Constructs a default ACIColor with index 0 (black).
Definition ACIColor.h:64
static const uint01 ASI_BLUE
ACI index for blue.
Definition ACIColor.h:122
ACIColor(const RGBColor &)
Constructs an ACIColor by finding the closest ACI match to an RGB color.
TranslatedString getName() const
Gets the translated display name of this ACI color.
static const uint01 ASI_YELLOW
ACI index for yellow.
Definition ACIColor.h:119
static const uint01 ASI_BLACK
ACI index for black.
Definition ACIColor.h:117
ACIColor(const HSLColor &)
Constructs an ACIColor by finding the closest ACI match to an HSL color.
ACIColor(const HSBColor &)
Constructs an ACIColor by finding the closest ACI match to an HSB color.
static const uint01 ASI_RED
ACI index for red.
Definition ACIColor.h:118
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
A color defined by hue, saturation, and luminosity components.
Definition HSLColor.h:51
Forward declaration of the NDEVR translated string class.
Definition LABColor.h:65
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.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...