VTK  9.3.20240422
vtkCIEDE2000.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2015 Greg Fiumara
3// SPDX-License-Identifier: BSD-3-Clause AND MIT
18#ifndef vtkCIEDE2000_h
19#define vtkCIEDE2000_h
20
21#include "vtkABINamespace.h"
22
23#include <vector> // needed for std::vector
24
25namespace CIEDE2000
26{
27VTK_ABI_NAMESPACE_BEGIN
31struct Node
32{
33 double rgb[3]; // RGB color
34 double distance; // Distance from the start
35};
36
40void MapColor(double rgb[3]);
41
46double GetCIEDeltaE2000(const double lab1[3], const double lab2[3]);
47
52double GetColorPath(const double rgb1[3], const double rgb2[3], std::vector<Node>& path,
53 bool forceExactSupportColors);
54VTK_ABI_NAMESPACE_END
55}
56
57#endif
58// VTK-HeaderTest-Exclude: vtkCIEDE2000.h
Private header used by vtkColorTransferFunction to support LAB/CIEDE2000 interpolation.
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.