vtk-m/vtkm/exec/ColorTable.h
Kenneth Moreland 3e1339f9a7 Remove deprecated features from VTK-m
With the major revision 2.0 of VTK-m, many items previously marked as
deprecated were removed. If updating to a new version of VTK-m, it is
recommended to first update to VTK-m 1.9, which will include the deprecated
features but provide warnings (with the right compiler) that will point to
the replacement code. Once the deprecations have been fixed, updating to
2.0 should be smoother.
2022-11-17 07:12:31 -06:00

96 lines
3.2 KiB
C++

//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_exec_ColorTable_h
#define vtk_m_exec_ColorTable_h
#include <vtkm/Types.h>
namespace vtkm
{
enum struct ColorSpace
{
RGB,
HSV,
HSVWrap,
Lab,
Diverging
};
} // namespace vtkm
namespace vtkm
{
namespace exec
{
class VTKM_ALWAYS_EXPORT ColorTable
{
public:
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpace(vtkm::Float64) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpace(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
inline VTKM_EXEC vtkm::Float32 MapThroughOpacitySpace(vtkm::Float64 value) const;
vtkm::ColorSpace Space;
vtkm::Float64 const* ColorNodes = nullptr;
vtkm::Vec3f_32 const* RGB = nullptr;
vtkm::Float64 const* ONodes = nullptr;
vtkm::Float32 const* Alpha = nullptr;
vtkm::Vec2f_32 const* MidSharp = nullptr;
vtkm::Int32 ColorSize = 0;
vtkm::Int32 OpacitySize = 0;
vtkm::Vec3f_32 NaNColor = { 0.5f, 0.0f, 0.0f };
vtkm::Vec3f_32 BelowRangeColor = { 0.0f, 0.0f, 0.0f };
vtkm::Vec3f_32 AboveRangeColor = { 0.0f, 0.0f, 0.0f };
bool UseClamping = true;
private:
inline VTKM_EXEC void FindColors(vtkm::Float64 value,
vtkm::Vec3f_32& first,
vtkm::Vec3f_32& second,
vtkm::Float32& weight) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpaceRGB(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpaceHSV(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpaceHSVWrap(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpaceLab(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
inline VTKM_EXEC vtkm::Vec3f_32 MapThroughColorSpaceDiverging(const vtkm::Vec3f_32& rgb1,
const vtkm::Vec3f_32& rgb2,
vtkm::Float32 weight) const;
};
}
}
#include <vtkm/exec/ColorTable.hxx>
#endif