21#include <vtkLookupTable.h>
47 void Build()
override;
60 void getColor(vtkIdType indx,
unsigned char rgba[4])
const;
89 unsigned char linInterpolation(
unsigned char a,
unsigned char b,
double p)
const;
92 unsigned char expInterpolation(
unsigned char a,
unsigned char b,
double gamma,
double p)
const;
94 std::map<double, unsigned char*>
_dict;
Calculates and stores a colour lookup table.
~VtkColorLookupTable() override
Destructor.
DataHolderLib::LUTType _type
void setColor(double pos, DataHolderLib::Color const &color)
unsigned char expInterpolation(unsigned char a, unsigned char b, double gamma, double p) const
Interpolates values exponentially. gamma should roughly be in [0,4), for gamma=1 interpolation is lin...
void writeToFile(const std::string &filename)
Exports a color table to a file.
std::map< double, unsigned char * > _dict
void SetTableValueRGBA(vtkIdType idx, unsigned char rgba[4])
Set a value within the LUT.
void Build() override
Builds the colour table based on the previously set parameters. This method should only be called aft...
unsigned char linInterpolation(unsigned char a, unsigned char b, double p) const
Interpolates values linearly.
static const int DEFAULTMAXVALUE
void GetTableValue(vtkIdType idx, unsigned char rgba[4])
Get a value from the LUT.
VtkColorLookupTable()
Constructor.
static const int DEFAULTMINVALUE
void setInterpolationType(DataHolderLib::LUTType type)
Sets the type of interpolation.
vtkTypeMacro(VtkColorLookupTable, vtkLookupTable)
void getColor(vtkIdType indx, unsigned char rgba[4]) const
void setLookupTable(DataHolderLib::ColorLookupTable const &lut)
Imports settings of OGS lookup table class.
DataHolderLib::LUTType getInterpolationType() const
Returns the type of interpolation used.
static VtkColorLookupTable * New()
Create new objects with New() because of VTKs object reference counting.
LUTType
Interpolation methods.
std::array< unsigned char, 4 > Color