DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
RandomColorMap.h
1
16
17
#pragma once
18
30
31
#if defined(RandomColorMap_RECURSES)
32
#error Recursive header files inclusion detected in RandomColorMap.h
33
#else
// defined(RandomColorMap_RECURSES)
35
#define RandomColorMap_RECURSES
36
37
#if !defined RandomColorMap_h
39
#define RandomColorMap_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/io/colormaps/GradientColorMap.h"
47
48
namespace
DGtal
49
{
50
52
// class RandomColorMap
59
class
RandomColorMap
60
{
61
// ----------------------- Standard services ------------------------------
62
public
:
63
64
65
typedef
unsigned
int
Value
;
66
67
68
74
RandomColorMap
(
const
RandomColorMap
& other );
75
82
RandomColorMap
&
operator=
(
const
RandomColorMap
& anOther );
83
84
89
90
RandomColorMap
(
const
unsigned
int
&aFirstIndex,
const
unsigned
int
& aLastIndex,
91
const
Color
&aFirstColor=
Color::White
,
const
Color
&aLastColor=
Color::Red
);
92
93
94
// RandomColorMap(const unsigned int &aFirstIndex, const unsigned int & aLastIndex);
95
96
97
103
void
addColor
(
const
Color
& aColor ) ;
104
105
112
Color
operator()
(
const
unsigned
int
& aValue )
const
;
113
114
120
const
unsigned
int
&
min
()
const
;
121
127
const
unsigned
int
&
max
()
const
;
128
129
133
~RandomColorMap
();
134
135
// ----------------------- Interface --------------------------------------
136
public
:
137
142
void
selfDisplay
( std::ostream & out )
const
;
143
148
bool
isValid
()
const
;
149
150
// ------------------------- Protected Data ------------------------------
151
protected
:
152
unsigned
int
myMin
;
153
unsigned
int
myMax
;
154
155
156
157
158
// ------------------------- Private Data --------------------------------
159
private
:
160
GradientColorMap<unsigned int>
*
myGradientMap
;
161
std::vector<unsigned int>
myColorIndex
;
162
std::vector<unsigned int>
myFreeColorIndex
;
163
164
165
void
associateRandomIndexColor
();
166
167
// ------------------------- Hidden services ------------------------------
168
protected
:
169
174
RandomColorMap
();
175
176
private
:
177
178
179
// ------------------------- Internals ------------------------------------
180
private
:
181
182
};
// end of class RandomColorMap
183
184
191
std::ostream&
192
operator<<
( std::ostream & out,
const
RandomColorMap
&
object
);
193
194
195
}
// namespace DGtal
196
197
199
// Includes inline functions.
200
#include "DGtal/io/colormaps/RandomColorMap.ih"
201
202
203
// //
205
206
#endif
// !defined RandomColorMap_h
207
208
#undef RandomColorMap_RECURSES
209
#endif
// else defined(RandomColorMap_RECURSES)
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition
Color.h:77
DGtal::Color::Red
static const Color Red
Definition
Color.h:425
DGtal::Color::White
static const Color White
Definition
Color.h:424
DGtal::GradientColorMap
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Definition
GradientColorMap.h:120
DGtal::RandomColorMap
Aim: access to random color from a gradientColorMap.
Definition
RandomColorMap.h:60
DGtal::RandomColorMap::max
const unsigned int & max() const
DGtal::RandomColorMap::isValid
bool isValid() const
DGtal::RandomColorMap::addColor
void addColor(const Color &aColor)
DGtal::RandomColorMap::myMax
unsigned int myMax
Definition
RandomColorMap.h:153
DGtal::RandomColorMap::min
const unsigned int & min() const
DGtal::RandomColorMap::RandomColorMap
RandomColorMap(const RandomColorMap &other)
DGtal::RandomColorMap::myMin
unsigned int myMin
Definition
RandomColorMap.h:152
DGtal::RandomColorMap::operator()
Color operator()(const unsigned int &aValue) const
DGtal::RandomColorMap::myColorIndex
std::vector< unsigned int > myColorIndex
Definition
RandomColorMap.h:161
DGtal::RandomColorMap::associateRandomIndexColor
void associateRandomIndexColor()
DGtal::RandomColorMap::~RandomColorMap
~RandomColorMap()
DGtal::RandomColorMap::operator=
RandomColorMap & operator=(const RandomColorMap &anOther)
DGtal::RandomColorMap::Value
unsigned int Value
Definition
RandomColorMap.h:65
DGtal::RandomColorMap::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::RandomColorMap::myGradientMap
GradientColorMap< unsigned int > * myGradientMap
Definition
RandomColorMap.h:160
DGtal::RandomColorMap::RandomColorMap
RandomColorMap()
DGtal::RandomColorMap::RandomColorMap
RandomColorMap(const unsigned int &aFirstIndex, const unsigned int &aLastIndex, const Color &aFirstColor=Color::White, const Color &aLastColor=Color::Red)
DGtal::RandomColorMap::myFreeColorIndex
std::vector< unsigned int > myFreeColorIndex
Definition
RandomColorMap.h:162
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
src
DGtal
io
colormaps
RandomColorMap.h
Generated on
for DGtal by
1.18.0