VTK-m  2.0
ConvertToRGBA.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_colorconversion_ScalarsToColors_h
11 #define vtk_m_worklet_colorconversion_ScalarsToColors_h
12 
14 
15 namespace vtkm
16 {
17 namespace worklet
18 {
19 namespace colorconversion
20 {
21 
23 {
24  using ControlSignature = void(FieldIn in, FieldOut out);
25  using ExecutionSignature = _2(_1);
26 
28  : Alpha(alpha)
29  {
30  }
31 
32  template <typename T>
33  VTKM_EXEC vtkm::Vec4ui_8 operator()(const T& in) const
34  { //vtkScalarsToColorsLuminanceToRGBA
37  }
38 
39  template <typename T>
41  { //vtkScalarsToColorsLuminanceAlphaToRGBA
44  return vtkm::Vec<UInt8, 4>(l, l, l, static_cast<vtkm::UInt8>(a * this->Alpha + 0.5f));
45  }
46 
47  template <typename T>
49  { //vtkScalarsToColorsRGBToRGBA
54  }
55 
56  template <typename T>
58  { //vtkScalarsToColorsRGBAToRGBA
63  static_cast<vtkm::UInt8>(a * this->Alpha + 0.5f));
64  }
65 
66  const vtkm::Float32 Alpha = 1.0f;
67 };
68 }
69 }
70 }
71 #endif
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::WorkletMapField::FieldOut
A control signature tag for output fields.
Definition: WorkletMapField.h:60
vtkm::worklet::colorconversion::ConvertToRGBA::operator()
VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec< T, 2 > &in) const
Definition: ConvertToRGBA.h:40
vtkm::worklet::colorconversion::ConvertToRGBA::operator()
VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec< T, 3 > &in) const
Definition: ConvertToRGBA.h:48
Conversions.h
vtkm::worklet::colorconversion::ConvertToRGBA::Alpha
const vtkm::Float32 Alpha
Definition: ConvertToRGBA.h:66
vtkm::worklet::colorconversion::ConvertToRGBA::operator()
VTKM_EXEC vtkm::Vec4ui_8 operator()(const T &in) const
Definition: ConvertToRGBA.h:33
vtkm::Vec< T, 4 >
Definition: Types.h:1093
vtkm::worklet::colorconversion::ConvertToRGBA
Definition: ConvertToRGBA.h:22
vtkm::worklet::WorkletMapField::FieldIn
A control signature tag for input fields.
Definition: WorkletMapField.h:49
vtkm::worklet::colorconversion::ConvertToRGBA::ExecutionSignature
_2(_1) ExecutionSignature
Definition: ConvertToRGBA.h:25
vtkm::Vec< T, 2 >
Definition: Types.h:859
vtkm::worklet::colorconversion::ConvertToRGBA::ControlSignature
void(FieldIn in, FieldOut out) ControlSignature
Definition: ConvertToRGBA.h:24
vtkm::UInt8
uint8_t UInt8
Definition: Types.h:157
vtkm::worklet::colorconversion::ColorToUChar
VTKM_EXEC vtkm::UInt8 ColorToUChar(T t)
Definition: Conversions.h:21
vtkm::Vec< T, 3 >
Definition: Types.h:975
vtkm::Vec
A short fixed-length array.
Definition: Types.h:767
vtkm::worklet::colorconversion::ConvertToRGBA::ConvertToRGBA
ConvertToRGBA(vtkm::Float32 alpha)
Definition: ConvertToRGBA.h:27
vtkm::Float32
float Float32
Definition: Types.h:154
vtkm::worklet::colorconversion::ConvertToRGBA::operator()
VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec< T, 4 > &in) const
Definition: ConvertToRGBA.h:57
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38