VTK
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 
48 #ifndef vtkCIEDE2000_h
49 #define vtkCIEDE2000_h
50 #ifndef __VTK_WRAP__
51 
52 #include <vector> // needed for std::vector
53 
54 namespace CIEDE2000
55 {
59 struct Node
60 {
61  double rgb[3]; // RGB color
62  double distance; // Distance from the start
63 };
64 
69 double GetCIEDeltaE2000(const double lab1[3], const double lab2[3]);
70 
75 double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector<Node>& path);
76 }
77 
78 #endif
79 #endif
80 // VTK-HeaderTest-Exclude: vtkCIEDE2000.h
Node of the color path.
Definition: vtkCIEDE2000.h:59
Private header used by vtkColorTransferFunction to support LAB/CIEDE2000 interpolation.
Definition: vtkCIEDE2000.h:54
double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector< Node > &path)
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...
double rgb[3]
Definition: vtkCIEDE2000.h:61