Go to the documentation of this file.
11 #ifndef TRANSFERFUNCTION_HPP
12 #define TRANSFERFUNCTION_HPP
55 typedef std::vector<std::pair<double, Colorf> >
value_list;
217 QString dump()
const;
222 void add_rgba_point(
double pos,
Colorf col);
227 void add_hsva_point(
double pos,
Colorf col);
232 void remove_point(
double pos);
238 return values.size();
244 void move_point(
double old_pos,
double new_pos);
249 double next_pos(
double old_pos)
const;
254 double prev_pos(
double old_pos)
const;
257 double operator[](
int i)
const;
264 Colorf rgba_point(
double position)
const;
270 Colorf hsva_point(
double position)
const;
276 Colorf rgba(
double position)
const;
281 Colorf hsva(
double position)
const;
286 double alpha(
double position)
const;
292 return values.empty();
330 void adjust(
double minValue,
double maxValue);
336 return _interpolation;
341 void setInterpolation(Interpolation i);
345 void setPointList(
const value_list& lst);
370 Colorf color(
double position)
const;
377 void add_point(
double pos,
Colorf col);
static TransferFunction scale_gray()
Scale in gray.
static TransferFunction constant_green()
Scale in transparency.
bool clamp
If true, the colors left and right of the defined points are clamped.
Color< float > Colorf
Type of a color.
value_list values
List of values.
static TransferFunction scale_green()
Scale in green.
static TransferFunction scale_red()
Scale in red.
Distributed matrix library.
static TransferFunction scale_yellow()
Scale in yellow.
static TransferFunction scale_purple()
Scale in purple.
Interpolation
Type of interpolation.
static TransferFunction constant_cyan()
Scale in transparency.
static TransferFunction constant_purple()
Scale in transparency.
static TransferFunction constant_yellow()
Scale in transparency.
T CU_HOST_DEVICE interpolate(const T &a, const T &b, const T &s)
Interpolate between values.
size_t size() const
Returns the number of points.
T CU_HOST_DEVICE max(const T a, const T b)
QMap< double, int > key_map
Type of the mapping from the position to the index in the value list.
key_map keys
Mapping of the position to the index in the value list.
virtual ~TransferFunction()
Virtual destructor.
bool empty() const
Returns true if no points are defined.
static TransferFunction constant_blue()
Scale in transparency.
static TransferFunction constant_red()
Scale in transparency.
Interpolation interpolation() const
Returns the current interpolation mode.
CU_HOST_DEVICE T min(const T a, const T b)
static TransferFunction scale_blue()
Scale in blue.
Colorf exteriorColor
Color left and right of the control points if not clamped.
static TransferFunction constant_gray()
Scale in transparency.
Interpolation _interpolation
Current interpolation mode.
static const double epsilon
epsilon used in floating point comparisons
static TransferFunction scale_cyan()
Scale in cyan.
std::vector< std::pair< double, Colorf > > value_list
Type of a list of value/colors.