Blame view

src/ParamOutputImpl/Plot/Color.hh 971 Bytes
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * Color.hh
 *
 *  Created on: 28 oct. 2013
 *      Author: CS
 */

#ifndef COLOR_HH_
#define COLOR_HH_

#include "PlotCommon.hh"

#include <ostream>
#include <vector>

namespace plot {

class Color {
public:

	Color();

	Color(int red, int green, int blue);

	Color(int colorMapIndex, int colorIndex);

	Color(const Color& color);

	virtual ~Color() {};

	bool isSet(){
		return _red != -1 || _colorIndex != -1;
	}

	int _red;
	int _green;
	int _blue;

	int _colorMapIndex;
	int _colorIndex;

	void dump(std::ostream& out, std::string& prefix) {
		out << prefix << "color.red=" << _red << std::endl;
		out << prefix << "color.green=" << _green << std::endl;
		out << prefix << "color.blue=" << _blue << std::endl;
		out << prefix << "color.mapindex=" << _colorMapIndex << std::endl;
		out << prefix << "color.index=" << _colorIndex << std::endl;
	}
};

std::ostream& operator << (std::ostream& out, const Color& color);

} /* namespace plot */
#endif /* COLOR_HH_ */