MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
25
26
29{
30public:
33
34
37
39 void setRelative(bool relative) override;
40
42 virtual double getRGBCenter(void) const
43 {
44 return _rgbRamp.getCenter();
45 }
46
48 virtual void setRGBCenter(double center)
49 {
50 _rgbRamp.setCenter(center);
51 changed();
52 }
53
55 virtual double getRGBWidth(void) const
56 {
57 return _rgbRamp.getWidth();
58 }
59
61 virtual void setRGBWidth(double width)
62 {
63 _rgbRamp.setWidth(width);
64 changed();
65 }
66
68 virtual void getRGBStart(double* r, double* g, double* b) const;
69
71 virtual void setRGBStart(double r, double g, double b);
72
74 virtual void getRGBEnd(double* r, double* g, double* b) const;
75
77 virtual void setRGBEnd(double r, double g, double b);
78
80 virtual double getAlphaCenter(void) const
81 {
82 return _alphaRamp.getCenter();
83 }
84
86 virtual void setAlphaCenter(double center)
87 {
88 _alphaRamp.setCenter(center);
89 changed();
90 }
91
93 virtual double getAlphaWidth(void) const
94 {
95 return _alphaRamp.getWidth();
96 }
97
99 virtual void setAlphaWidth(double width)
100 {
101 _alphaRamp.setWidth(width);
102 changed();
103 }
104
106 virtual double getAlphaStart(void) const
107 {
108 return _alphaRamp.getBaseValue();
109 }
110
112 virtual void setAlphaStart(double a)
113 {
114 _alphaRamp.setBaseValue(a);
115 changed();
116 }
117
119 virtual double getAlphaEnd(void) const
120 {
121 return _alphaRamp.getPeakValue();
122 }
123
125 virtual void setAlphaEnd(double a)
126 {
127 _alphaRamp.setPeakValue(a);
128 changed();
129 }
130
132
133
136
138 double getNativeMinIndex(void) const override;
139
141 double getNativeMaxIndex(void) const override;
142
144
145
146protected:
149
155
163 double maxIndex) const override;
164
167
173 const LUTData<T>* alphaLut) const;
174
176
177
180
183
185 double _rgbStart[3], _rgbEnd[3];
186
187
189};
190
191
193
194
195#endif
196// __mlLUTFRampPair_H
Untyped base class for LUTData template classes.
Definition mlLUTData.h:65
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Definition mlLUTData.h:308
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.