VTK  9.2.6
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 
57 #include <vector> // needed for std::vector
58 
59 namespace CIEDE2000
60 {
64 struct Node
65 {
66  double rgb[3]; // RGB color
67  double distance; // Distance from the start
68 };
69 
73 void MapColor(double rgb[3]);
74 
79 double GetCIEDeltaE2000(const double lab1[3], const double lab2[3]);
80 
85 double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector<Node>& path,
86  bool forceExactSupportColors);
87 }
88 
89 #endif
90 // VTK-HeaderTest-Exclude: vtkCIEDE2000.h
Node of the color path.
Definition: vtkCIEDE2000.h:64
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...
Private header used by vtkColorTransferFunction to support LAB/CIEDE2000 interpolation.
Definition: vtkCIEDE2000.h:59
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...
void MapColor(double rgb[3])
Map a RGB color to its corresponding color in the sampled RGB space.
double rgb[3]
Definition: vtkCIEDE2000.h:66