1 #ifndef CELL_MAPPING_CPP_COLORING_H 2 #define CELL_MAPPING_CPP_COLORING_H 10 void hsv2rgb(
double h,
double s,
double v,
double& r,
double& g,
double& b);
12 template <
class CellType,
class IDType>
15 virtual std::vector<char>
createColor(
const CellType& cell,
const IDType periodicGroups) {
16 return std::vector<char>(3, 0);
20 template <
class CellType,
class IDType>
22 std::vector<char> createColor(
const CellType& cell,
23 const IDType periodicGroups) {
24 IDType group = cell.getGroup();
25 IDType step = cell.getStep();
28 h = double(group) / periodicGroups;
30 double transient_steps = 500.0;
32 v = 0.85 - fmin(0.5 * (
double(step) / transient_steps), 0.5);
41 std::vector<char> rgb(3);
42 rgb[0]=(char)(r*255.0);
43 rgb[1]=(char)(g*255.0);
44 rgb[2]=(char)(b*255.0);
49 template <
class CellType,
class IDType>
51 std::vector<char> createColor(
const CellType& cell,
52 const IDType periodicGroups) {
53 IDType group = cell.getGroup();
54 IDType step = cell.getStep();
55 IDType clusterID = cell.getClusterID();
58 h = double(group) / periodicGroups;
60 double transient_steps = 500.0;
62 v = 0.85 - fmin(0.5 * (
double(step) / transient_steps), 0.5);
71 std::vector<char> rgb(3);
72 rgb[0]=(char)(r*255.0);
73 rgb[1]=(char)(g*255.0);
74 rgb[2]=(char)(b*255.0);
79 template <
class CellType,
class IDType>
81 std::vector<char> createColor(
const CellType& cell,
82 const IDType periodicGroups) {
83 IDType group = cell.getGroup();
84 IDType step = cell.getStep();
87 double transient_steps = 200.0;
88 h = double(step)/transient_steps;
96 std::vector<char> rgb(3);
104 template <
class CellType,
class IDType>
106 std::vector<char> createColor(
const CellType& cell,
107 const IDType periodicGroups) {
108 IDType group = cell.getGroup();
109 IDType step = cell.getStep();
114 v = 0.6+0.4*double(step)/200.0;
if (v > 1.0) v = 1.0;
115 if (step == 0) { v = 0.0; }
118 std::vector<char> rgb(3);
119 rgb[0]=(char)(r*255);
120 rgb[1]=(char)(g*255);
121 rgb[2]=(char)(b*255);
128 #endif //CELL_MAPPING_CPP_COLORING_H Definition: coloring.h:80
Definition: coloring.h:50
void hsv2rgb(double h, double s, double v, double &r, double &g, double &b)
Definition: coloring.cpp:9
Definition: coloring.h:21
Definition: coloring.h:105
Definition: coloring.h:13
virtual std::vector< char > createColor(const CellType &cell, const IDType periodicGroups)
Definition: coloring.h:15