API Documentation
Loading...
Searching...
No Matches
LABColor.h
Go to the documentation of this file.
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;
44 /**----------------------------------------------------------------------------
45 \brief A Lab color space is a color-opponent space with dimension L for luminance
46 and a and b for the color-opponent dimensions, based on nonlinearly-compressed CIE XYZ color space coordinates.
47
48 IE L*a*b* color space, also know as CIE 1976 color space, stands for:
49 L*, the luminance
50 a*, the red/green color-opponent dimension
51 b*, the yellow/blue color-opponent dimension
52 The L*a*b* color model has been created to serve as a device independent
53 model to be used as a reference. It is based directly on the CIE 1931 XYZ
54 color space as an attempt to linearize the perceptibility of color differences.
55 The non-linear relations for L*, a*, and b* are intended to mimic the
56 logarithmic response of the eye, coloring information is referred to the color
57 of the white point of the system.
58 Useful for color comparisions, distances, etc
59 ----------------------------------------------------------------------------*/
60 class LABColor : public Vector<4, fltp04>, public Color
61 {
62 public:
63 constexpr LABColor()
64 {}
65 constexpr LABColor(fltp04 x, fltp04 y, fltp04 z, fltp04 a = 1.0f)
66 : Vector<4, fltp04>(x, y, z, a)
67 {}
68 constexpr LABColor(const Vector<4, fltp04>& lab)
69 : Vector<4, fltp04>(lab)
70 {}
71 NDEVR_BASE_API explicit LABColor(const XYZColor& lab);
72 NDEVR_BASE_API explicit LABColor(const ACIColor& lab);
73 NDEVR_BASE_API explicit LABColor(const HSBColor& lab);
74 NDEVR_BASE_API explicit LABColor(const RGBColor& lab);
75#if NDEVR_INCLUDE_RAL_COLORS
77 NDEVR_BASE_API const TranslatedString& getName() const;
78#endif
79 };
80 static_assert(sizeof(LABColor) == 16, "Bad color size");
84}
85
#define NDEVR_BASE_API
Definition DLLInfo.h:57
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
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
constexpr LABColor()
Definition LABColor.h:63
constexpr LABColor(const Vector< 4, fltp04 > &lab)
Definition LABColor.h:68
NDEVR_BASE_API LABColor(const ACIColor &lab)
NDEVR_BASE_API LABColor(const XYZColor &lab)
constexpr LABColor(fltp04 x, fltp04 y, fltp04 z, fltp04 a=1.0f)
Definition LABColor.h:65
NDEVR_BASE_API LABColor(const HSBColor &lab)
NDEVR_BASE_API LABColor(const RGBColor &lab)
Definition MemoryManager.h:261
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
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
In opposition to the previous models, the CIE XYZ model defines an absolute color space....
Definition XYZColor.h:51
Definition ACIColor.h:37
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
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233