VTK  9.0.1
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 /*=========================================================================
17 The MIT License (MIT)
18 
19 Copyright (c) 2015 Greg Fiumara
20 
21 Permission is hereby granted, free of charge, to any person obtaining a copy
22 of this software and associated documentation files (the "Software"), to deal
23 in the Software without restriction, including without limitation the rights
24 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 copies of the Software, and to permit persons to whom the Software is
26 furnished to do so, subject to the following conditions:
27 
28 The above copyright notice and this permission notice shall be included in all
29 copies or substantial portions of the Software.
30 
31 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 SOFTWARE.
38 =========================================================================*/
39 
54 #ifndef vtkCIEDE2000_h
55 #define vtkCIEDE2000_h
56 #ifndef __VTK_WRAP__
57 
58 #include <vector> // needed for std::vector
59 
60 namespace CIEDE2000
61 {
65 struct Node
66 {
67  double rgb[3]; // RGB color
68  double distance; // Distance from the start
69 };
70 
74 void MapColor(double rgb[3]);
75 
80 double GetCIEDeltaE2000(const double lab1[3], const double lab2[3]);
81 
86 double 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