QXRD
0.11.16
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qxrd
source
qxrdmaskcolormap.cpp
Go to the documentation of this file.
1
#include "
qxrdmaskcolormap.h
"
2
3
QxrdMaskColorMap::QxrdMaskColorMap
(
const
QColor &deselcol,
const
QColor &selcol)
4
: QwtLinearColorMap(QwtColorMap::RGB),
5
m_DeselectedColor
(deselcol.rgba()),
6
m_SelectedColor
(selcol.rgba())
7
{
8
}
9
10
QxrdMaskColorMap::QxrdMaskColorMap
()
11
: QwtLinearColorMap(QwtColorMap::RGB),
12
m_DeselectedColor
(qRgba(255,0,0,255)),
13
m_SelectedColor
(qRgba(255,0,0,0))
14
{
15
}
16
17
//QxrdMaskColorMap* QxrdMaskColorMap::copy() const
18
//{
19
// QxrdMaskColorMap *map = new QxrdMaskColorMap();
20
21
// *map = *this;
22
23
// return map;
24
//}
25
26
QRgb
QxrdMaskColorMap::rgb
(
const
QwtInterval &
/*inter*/
,
double
value)
const
27
{
28
if
(value > 0.5) {
29
return
m_SelectedColor
;
30
}
else
{
31
return
m_DeselectedColor
;
32
}
33
34
// int v = value;
35
36
// if (v & 1) {
37
// return qRgba(255,0,0,0);
38
// } else if (v & 2) {
39
// return qRgba(0,255,0,255);
40
// } else {
41
// return qRgba(255,0,0,255);
42
// }
43
// int v = (int)((1.0-value)*255.0);
44
// if (v<0) v=0;
45
// if (v>255) v=255;
46
//
47
// return qRgba(255,0,0, v);
48
}
49
50
unsigned
char
QxrdMaskColorMap::colorIndex
(
const
QwtInterval &
/*inter*/
,
double
/*value*/
)
const
51
{
52
return
0;
53
}
QxrdMaskColorMap::colorIndex
unsigned char colorIndex(const QwtInterval &inter, double value) const
Definition:
qxrdmaskcolormap.cpp:50
QxrdMaskColorMap::rgb
QRgb rgb(const QwtInterval &inter, double value) const
Definition:
qxrdmaskcolormap.cpp:26
qxrdmaskcolormap.h
QxrdMaskColorMap::m_DeselectedColor
QRgb m_DeselectedColor
Definition:
qxrdmaskcolormap.h:20
QxrdMaskColorMap::QxrdMaskColorMap
QxrdMaskColorMap()
Definition:
qxrdmaskcolormap.cpp:10
QxrdMaskColorMap::m_SelectedColor
QRgb m_SelectedColor
Definition:
qxrdmaskcolormap.h:21
Generated by
1.8.10