MeVisLab Toolbox Reference
mlLUTFRampPair.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_LUTFRAMP_PAIR_H
14#define ML_LUTFRAMP_PAIR_H
15
16
18
19#include "mlLUTSystem.h"
20#include "mlLUTFunction.h"
21#include "mlLUTFPrimitive.h"
22
23
24
26
27
30{
31public:
32
35
36
39
41 void setRelative (bool relative) override;
42
44 virtual double getRGBCenter (void) const { return _rgbRamp.getCenter(); }
45
47 virtual void setRGBCenter (double center) { _rgbRamp.setCenter(center); changed(); }
48
50 virtual double getRGBWidth (void) const { return _rgbRamp.getWidth(); }
51
53 virtual void setRGBWidth (double width) { _rgbRamp.setWidth(width); changed(); }
54
56 virtual void getRGBStart (double *r, double *g, double *b) const;
57
59 virtual void setRGBStart (double r, double g, double b);
60
62 virtual void getRGBEnd (double *r, double *g, double *b) const;
63
65 virtual void setRGBEnd (double r, double g, double b);
66
68 virtual double getAlphaCenter (void) const { return _alphaRamp.getCenter(); }
69
71 virtual void setAlphaCenter (double center) { _alphaRamp.setCenter(center); changed(); }
72
74 virtual double getAlphaWidth (void) const { return _alphaRamp.getWidth(); }
75
77 virtual void setAlphaWidth (double width) { _alphaRamp.setWidth(width); changed(); }
78
80 virtual double getAlphaStart (void) const { return _alphaRamp.getBaseValue(); }
81
83 virtual void setAlphaStart (double a) { _alphaRamp.setBaseValue(a); changed(); }
84
86 virtual double getAlphaEnd (void) const { return _alphaRamp.getPeakValue(); }
87
89 virtual void setAlphaEnd (double a) { _alphaRamp.setPeakValue(a); changed(); }
90
92
93
96
98 double getNativeMinIndex (void) const override;
99
101 double getNativeMaxIndex (void) const override;
102
104
105
106protected:
107
110
116
124 double minIndex, double maxIndex) const override;
125
128
133 template <typename T>
135 const LUTData<double> *rgbLut, const LUTData<T> *alphaLut) const;
136
138
139
142
145
147 double _rgbStart[3], _rgbEnd[3];
148
149
150
152
153};
154
155
157
158
159#endif
160// __mlLUTFRampPair_H
Untyped base class for LUTData template classes.
Definition mlLUTData.h:64
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Definition mlLUTData.h:243
A single channel LUT with predefined primitives of different shapes.
An RGBA LUT consisting of a RGB ramp and an alpha ramp.
virtual void setAlphaEnd(double a)
Set alpha end value.
virtual double getRGBCenter(void) const
Get RGB ramp center.
virtual double getAlphaWidth(void) const
Get alpha ramp width.
bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.
virtual void setRGBStart(double r, double g, double b)
Set start color RGB.
virtual double getAlphaEnd(void) const
Get alpha end value.
virtual void getRGBEnd(double *r, double *g, double *b) const
Store end color RGB in r, g, b (if not null)
virtual void getRGBStart(double *r, double *g, double *b) const
Store start color RGB in r, g, b (if not null)
virtual double getRGBWidth(void) const
Get RGB ramp width.
void setRelative(bool relative) override
Set/reset relative flag.
virtual void setRGBWidth(double width)
Set RGB ramp width.
bool copyLUT(LUTData< T > *lutData, LUTIterator< T > *lutIterator, const LUTData< double > *rgbLut, const LUTData< T > *alphaLut) const
Copy the single-channel LUTs rgbLut and alphaLut into lutData, applying RGB start and end color to th...
ML_CLASS_HEADER(LUTFRampPair)
virtual double getAlphaCenter(void) const
Get alpha ramp center.
LUTFRampPair(void)
Constructor.
LUTFPrimitive _alphaRamp
Alpha ramp LUT function.
virtual LUTDataBase * createLUT(LUTDataBase *lutData) const
Create single-channel LUT with same index and entry range as lutData.
virtual void setAlphaCenter(double center)
Set alpha ramp center.
virtual void setAlphaWidth(double width)
Set alpha ramp width.
double getNativeMaxIndex(void) const override
Get native maximum index.
bool renderLUTRescaled(LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override
Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers.
LUTFPrimitive _rgbRamp
RGB ramp LUT function.
double getNativeMinIndex(void) const override
Get native minimum index.
virtual void setRGBCenter(double center)
Set RGB ramp center.
virtual double getAlphaStart(void) const
Get alpha start value.
virtual void setRGBEnd(double r, double g, double b)
Set end color RGB.
virtual void setAlphaStart(double a)
Set alpha start value.
Common base class for lookup tables.
void changed(void)
Assign a new LUT ID.
LUT iterator base class with type independent functionality and declarations.
The LUTIterator class template is used by a LUTFunction object for rendering into a LUTData object.
#define MLLUT_EXPORT
System specific macro definitions.
Definition mlLUTSystem.h:25
Target mlrange_cast(Source arg)
Generic version of checked ML casts.