DGtal 1.3.0
Loading...
Searching...
No Matches
RandomColorMap.h
1
17#pragma once
18
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
48namespace DGtal
49{
50
52// class RandomColorMap
60{
61 // ----------------------- Standard services ------------------------------
62public:
63
64
65 typedef unsigned int Value;
66
67
68
74 RandomColorMap ( const RandomColorMap & other );
75
83
84
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
134
135 // ----------------------- Interface --------------------------------------
136public:
137
142 void selfDisplay ( std::ostream & out ) const;
143
148 bool isValid() const;
149
150 // ------------------------- Protected Datas ------------------------------
151protected:
152 unsigned int myMin;
153 unsigned int myMax;
158 // ------------------------- Private Datas --------------------------------
159private:
161 std::vector<unsigned int> myColorIndex;
162 std::vector<unsigned int> myFreeColorIndex;
163
164
166
167 // ------------------------- Hidden services ------------------------------
168protected:
169
175
176private:
177
178
179 // ------------------------- Internals ------------------------------------
180private:
181
182}; // end of class RandomColorMap
183
184
191std::ostream&
192operator<< ( 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)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
static const Color Red
Definition: Color.h:416
static const Color White
Definition: Color.h:415
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: access to random color from a gradientColorMap.
const unsigned int & max() const
bool isValid() const
void addColor(const Color &aColor)
const unsigned int & min() const
RandomColorMap(const RandomColorMap &other)
Color operator()(const unsigned int &aValue) const
std::vector< unsigned int > myColorIndex
void associateRandomIndexColor()
RandomColorMap & operator=(const RandomColorMap &anOther)
void selfDisplay(std::ostream &out) const
GradientColorMap< unsigned int > * myGradientMap
RandomColorMap(const unsigned int &aFirstIndex, const unsigned int &aLastIndex, const Color &aFirstColor=Color::White, const Color &aLastColor=Color::Red)
std::vector< unsigned int > myFreeColorIndex
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)