open_iA  2020.04
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Member Functions | Protected Attributes | List of all members
iALookupTable Class Reference

Class representing a lookup table for color coding. More...

#include <iALookupTable.h>

Collaboration diagram for iALookupTable:

Public Member Functions

void allocate (size_t numberOfColors)
 Allocate place for a given number of colors and fill with zeros. More...
 
void copyFromVTK (vtkLookupTable *vtk_lut)
 Copies data from the existing VTK lookup table (vtkLookupTable). More...
 
void getColor (double val, double *rgba_out) const
 Map a scalar value into an RGBA color. More...
 
QColor getQColor (double val) const
 Map a scalar value into an QColor object. More...
 
const double * getRange () const
 Get the mapped scalar range. More...
 
void getTableValue (size_t index, double *rgba_out) const
 Get the RGBA color value for a given index in the table. More...
 
 iALookupTable ()
 Set up an empty (uninitialized) iALookupTable. More...
 
 iALookupTable (vtkLookupTable *vtk_lut)
 Initialize an iALookupTable from the given vtkLookupTable. More...
 
bool initialized () const
 Check if the table has data (initialized). More...
 
size_t numberOfValues () const
 Get the number of values in the table. More...
 
void setColor (size_t colInd, double *rgba)
 Assign an RGBA color (every component 0..1) to a given index in the table. More...
 
void setColor (size_t colInd, QColor const &col)
 Assign a color specified by a QColor to a given index in the table. More...
 
void setData (size_t numberOfColors, double *rgba_data)
 Fill the lookup table using provided raw RBGA data for a given number of colors. More...
 
void setOpacity (double alpha)
 Set a given alpha value for every color in the table. More...
 
void setRange (double const *range)
 Set the mapped scalar range. More...
 
void setRange (double from_val, double to_val)
 Set the mapped scalar range. More...
 

Protected Attributes

std::vector< double > m_data
 lookup table raw color data, each color is 4 doubles (RGBA) More...
 
bool m_isInitialized
 flag which is on if lookup table data is set More...
 
size_t m_numColors
 number of colors stored in the lookup table More...
 
double m_range [2]
 scalar range mapped by the lookup table More...
 
double m_rangeLen
 length of the total scalar range that is mapped by the lookup table More...
 

Detailed Description

Class representing a lookup table for color coding.

Used for example in the scatter plot matrix iAQSplom. Has methods for importing an existing VTK lookup table, and for mapping scalar values to a corresponding QColor.

Constructor & Destructor Documentation

◆ iALookupTable() [1/2]

iALookupTable::iALookupTable ( )

Set up an empty (uninitialized) iALookupTable.

◆ iALookupTable() [2/2]

iALookupTable::iALookupTable ( vtkLookupTable *  vtk_lut)
explicit

Initialize an iALookupTable from the given vtkLookupTable.

Member Function Documentation

◆ allocate()

void iALookupTable::allocate ( size_t  numberOfColors)

Allocate place for a given number of colors and fill with zeros.

◆ copyFromVTK()

void iALookupTable::copyFromVTK ( vtkLookupTable *  vtk_lut)

Copies data from the existing VTK lookup table (vtkLookupTable).

◆ getColor()

void iALookupTable::getColor ( double  val,
double *  rgba_out 
) const

Map a scalar value into an RGBA color.

◆ getQColor()

QColor iALookupTable::getQColor ( double  val) const

Map a scalar value into an QColor object.

◆ getRange()

const double * iALookupTable::getRange ( ) const

Get the mapped scalar range.

◆ getTableValue()

void iALookupTable::getTableValue ( size_t  index,
double *  rgba_out 
) const

Get the RGBA color value for a given index in the table.

◆ initialized()

bool iALookupTable::initialized ( ) const

Check if the table has data (initialized).

◆ numberOfValues()

size_t iALookupTable::numberOfValues ( ) const

Get the number of values in the table.

◆ setColor() [1/2]

void iALookupTable::setColor ( size_t  colInd,
double *  rgba 
)

Assign an RGBA color (every component 0..1) to a given index in the table.

◆ setColor() [2/2]

void iALookupTable::setColor ( size_t  colInd,
QColor const &  col 
)

Assign a color specified by a QColor to a given index in the table.

◆ setData()

void iALookupTable::setData ( size_t  numberOfColors,
double *  rgba_data 
)

Fill the lookup table using provided raw RBGA data for a given number of colors.

◆ setOpacity()

void iALookupTable::setOpacity ( double  alpha)

Set a given alpha value for every color in the table.

◆ setRange() [1/2]

void iALookupTable::setRange ( double const *  range)

Set the mapped scalar range.

◆ setRange() [2/2]

void iALookupTable::setRange ( double  from_val,
double  to_val 
)

Set the mapped scalar range.

Member Data Documentation

◆ m_data

std::vector<double> iALookupTable::m_data
protected

lookup table raw color data, each color is 4 doubles (RGBA)

◆ m_isInitialized

bool iALookupTable::m_isInitialized
protected

flag which is on if lookup table data is set

◆ m_numColors

size_t iALookupTable::m_numColors
protected

number of colors stored in the lookup table

◆ m_range

double iALookupTable::m_range[2]
protected

scalar range mapped by the lookup table

◆ m_rangeLen

double iALookupTable::m_rangeLen
protected

length of the total scalar range that is mapped by the lookup table


The documentation for this class was generated from the following files: