VTK  9.1.0
vtkCIEDE2000.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCIEDE2000.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
16/*=========================================================================
17The MIT License (MIT)
18
19Copyright (c) 2015 Greg Fiumara
20
21Permission is hereby granted, free of charge, to any person obtaining a copy
22of this software and associated documentation files (the "Software"), to deal
23in the Software without restriction, including without limitation the rights
24to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25copies of the Software, and to permit persons to whom the Software is
26furnished to do so, subject to the following conditions:
27
28The above copyright notice and this permission notice shall be included in all
29copies or substantial portions of the Software.
30
31THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37SOFTWARE.
38=========================================================================*/
39
54#ifndef vtkCIEDE2000_h
55#define vtkCIEDE2000_h
56#ifndef __VTK_WRAP__
57
58#include <vector> // needed for std::vector
59
60namespace CIEDE2000
61{
65struct Node
66{
67 double rgb[3]; // RGB color
68 double distance; // Distance from the start
69};
70
74void MapColor(double rgb[3]);
75
80double GetCIEDeltaE2000(const double lab1[3], const double lab2[3]);
81
86double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector<Node>& path,
87 bool forceExactSupportColors);
88}
89
90#endif
91#endif
92// VTK-HeaderTest-Exclude: vtkCIEDE2000.h
Private header used by vtkColorTransferFunction to support LAB/CIEDE2000 interpolation.
Definition: vtkCIEDE2000.h:61
void MapColor(double rgb[3])
Map a RGB color to its corresponding color in the sampled RGB space.
double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector< Node > &path, bool forceExactSupportColors)
Calculates the shortest color path between two colors with respect to the CIEDE2000 measure and retur...
double GetCIEDeltaE2000(const double lab1[3], const double lab2[3])
Returns the distance between two colors as given by the CIE Delta E 2000 (CIEDE2000) color distance m...
Node of the color path.
Definition: vtkCIEDE2000.h:66
double rgb[3]
Definition: vtkCIEDE2000.h:67