56
56
"Otherwise, only images with boxes are saved.", false);
58
58
ParameteredObject::_addParameter(
59
drawDiagonal, "drawDiagonal",
60
"Draw diagonal for final results", true);
62
ParameteredObject::_addParameter(
63
59
resultsFinal, "resultsFinal",
64
60
"draw final results", true);
66
62
ParameteredObject::_addParameter(
67
resultsNormal, "resultsNormal",
68
"draw normal results", true);
70
ParameteredObject::_addParameter(
71
resultsDeleted, "resultsDeleted",
72
"draw deleted results", true);
74
ParameteredObject::_addParameter(
75
colorR, "colorR", "Color: red (0-255)", 0u);
76
ParameteredObject::_addParameter(
77
colorG, "colorG", "Color: green (0-255)", 0u);
78
ParameteredObject::_addParameter(
79
colorB, "colorB", "Color: blue (0-255)", 255u);
63
resultsAdd, "resultsAdd",
64
"draw add results", true);
66
ParameteredObject::_addParameter(
67
resultsDone, "resultsDone",
68
"draw done results", true);
70
ParameteredObject::_addParameter(
71
resultsFailed, "resultsFailed",
72
"draw failed results", true);
74
ParameteredObject::_addParameter(
75
resultsEdit, "resultsEdit",
76
"draw edit results", true);
78
ParameteredObject::_addParameter(
79
colorR, "colorR", "Color: red (0-255)", 255u);
80
ParameteredObject::_addParameter(
81
colorG, "colorG", "Color: green (0-255)", 255u);
82
ParameteredObject::_addParameter(
83
colorB, "colorB", "Color: blue (0-255)", 0u);
81
85
ParameteredObject::_addParameter(
82
86
colorRWrong, "colorRWrong", "Wrong Color: red (0-255)", 255u);
93
97
colorBFinal, "colorBFinal", "Final Color: blue (0-255)", 0u);
95
99
ParameteredObject::_addParameter(
96
colorRFinalWrong, "colorRFinalWrong", "Final Wrong Color: red (0-255)", 255u);
97
ParameteredObject::_addParameter(
98
colorGFinalWrong, "colorGFinalWrong", "Final Wrong Color: green (0-255)", 255u);
99
ParameteredObject::_addParameter(
100
colorBFinalWrong, "colorBFinalWrong", "Final Wrong Color: blue (0-255)", 0u);
100
colorRFinalWrong, "colorREdit", "Final Wrong Color: red (0-255)", 0u);
101
ParameteredObject::_addParameter(
102
colorGFinalWrong, "colorGEdit", "Final Wrong Color: green (0-255)", 0u);
103
ParameteredObject::_addParameter(
104
colorBFinalWrong, "colorBEdit", "Final Wrong Color: blue (0-255)", 255u);
103
107
std::string getFilepath( std::string filename, const std::vector<std::string> &list ){
124
128
assert (colorB() < 256u);
127
const unsigned char color[] = {
131
unsigned char color[] = {
128
132
(unsigned char) this->colorR(),
129
133
(unsigned char) this->colorG(),
130
134
(unsigned char) this->colorB()
133
137
// paint wrong color
134
const unsigned char color2[] = {
138
unsigned char color2[] = {
135
139
(unsigned char) this->colorRWrong(),
136
140
(unsigned char) this->colorGWrong(),
137
141
(unsigned char) this->colorBWrong()
140
144
// paint final color
141
const unsigned char color3[] = {
145
unsigned char color3[] = {
142
146
(unsigned char) this->colorRFinal(),
143
147
(unsigned char) this->colorGFinal(),
144
148
(unsigned char) this->colorBFinal()
147
151
// paint final color
148
const unsigned char colorDeletedFinal[] = {
152
unsigned char color4[] = {
149
153
(unsigned char) this->colorRFinalWrong(),
150
154
(unsigned char) this->colorGFinalWrong(),
151
155
(unsigned char) this->colorBFinalWrong()
193
197
int y1 = std::max(0, std::min(h - 1, (int)box->y1));
194
198
int x2 = std::max(0, std::min(w - 1, (int)box->x2));
195
199
int y2 = std::max(0, std::min(h - 1, (int)box->y2));
198
(box->deleted && this->resultsDeleted()) ||
199
(box->finalized && this->resultsFinal()) ||
200
(!box->finalized && !box->deleted && this->resultsNormal())
206
// diagonal for final results
207
if (box->finalized && !box->deleted && this->drawDiagonal()){
208
img.draw_line(x1, y1, x2, y2, color3);
209
img.draw_line(x2, y1, x1, y2, color3);
212
img.draw_line(x1, y1, x2, y1, (box->finalized && box->deleted ? colorDeletedFinal : (box->finalized ? color3 : (box->deleted ? color2 : color)))); // top
213
img.draw_line(x2, y1, x2, y2, (box->finalized && box->deleted ? colorDeletedFinal : (box->finalized ? color3 : (box->deleted ? color2 : color)))); // right
214
img.draw_line(x1, y2, x2, y2, (box->finalized && box->deleted ? colorDeletedFinal : (box->finalized ? color3 : (box->deleted ? color2 : color)))); // bottom
215
img.draw_line(x1, y1, x1, y2, (box->finalized && box->deleted ? colorDeletedFinal : (box->finalized ? color3 : (box->deleted ? color2 : color)))); // left
203
unsigned char *col = &color[0];
205
if (box->taskResultState == "Done" && this->resultsDone())
207
else if (box->taskResultState == "Edit" && this->resultsEdit())
209
else if (box->taskResultState == "Add" && this->resultsAdd())
211
else if (box->taskResultState == "Failed" && this->resultsFailed())
213
else if (box->taskResultState == "Final" && this->resultsFinal()){
215
img.draw_line(x1, y1, x2, y2, col);
216
img.draw_line(x2, y1, x1, y2, col);
222
img.draw_line(x1, y1, x2, y1, col); // top
223
img.draw_line(x2, y1, x2, y2, col); // right
224
img.draw_line(x1, y2, x2, y2, col); // bottom
225
img.draw_line(x1, y1, x1, y2, col); // left