Go to the documentation of this file.
10 #ifndef vtk_m_worklet_colorconversion_LookupTable_h
11 #define vtk_m_worklet_colorconversion_LookupTable_h
25 namespace colorconversion
42 this->Shift =
static_cast<vtkm::Float32>(-colorTableSamples.SampleRange.Min);
43 double rangeDelta = colorTableSamples.SampleRange.Length();
44 if (rangeDelta < DBL_MIN * colorTableSamples.NumberOfSamples)
52 this->Scale =
static_cast<vtkm::Float32>(colorTableSamples.NumberOfSamples / rangeDelta);
54 this->TableRange = colorTableSamples.SampleRange;
55 this->NumberOfSamples = colorTableSamples.NumberOfSamples;
61 template <
typename T,
typename WholeFieldIn,
typename U,
int N>
63 const WholeFieldIn lookupTable,
73 idx = this->NumberOfSamples + 3;
79 else if (v == this->TableRange.
Min)
83 else if (v > this->TableRange.
Max)
85 idx = this->NumberOfSamples + 2;
87 else if (v == this->TableRange.
Max)
93 v = (v + this->
Shift) * this->Scale;
99 output = lookupTable.Get(idx);
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
A control signature tag for output fields.
Definition: WorkletMapField.h:60
vtkm::Range TableRange
Definition: LookupTable.h:34
VTKM_EXEC void operator()(const T &in, const WholeFieldIn lookupTable, vtkm::Vec< U, N > &output) const
Definition: LookupTable.h:62
vtkm::Float32 Scale
Definition: LookupTable.h:33
Definition: LookupTable.h:30
void(FieldIn in, WholeArrayIn lookup, FieldOut color) ControlSignature
Definition: LookupTable.h:58
A control signature tag for input fields.
Definition: WorkletMapField.h:49
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT LookupTable(const T &colorTableSamples)
Definition: LookupTable.h:40
A short fixed-length array.
Definition: Types.h:767
vtkm::Int32 NumberOfSamples
Definition: LookupTable.h:35
vtkm::Float64 Min
Definition: Range.h:33
float Float32
Definition: Types.h:154
int32_t Int32
Definition: Types.h:160
double Float64
Definition: Types.h:155
void(_1, _2, _3) ExecutionSignature
Definition: LookupTable.h:59
vtkm::Float64 Max
Definition: Range.h:34
vtkm::Float32 Shift
Definition: LookupTable.h:32
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
Represent a continuous scalar range of values.
Definition: Range.h:31