mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Remove duplicated code
This commit is contained in:
parent
b6f3368f03
commit
e5c47ffb79
@ -203,8 +203,6 @@ public:
|
|||||||
int i;
|
int i;
|
||||||
Node *child;
|
Node *child;
|
||||||
if (this->is_leaf) {
|
if (this->is_leaf) {
|
||||||
#define AVG_COLOR(x) ((unsigned char) ((double)this->sum.x / (double)this->pixel_count))
|
|
||||||
this->avg.red = AVG_COLOR(red); this->avg.green = AVG_COLOR(green); this->avg.blue = AVG_COLOR(blue);
|
|
||||||
color_table[*index] = qRgb(this->avg.red, this->avg.green, this->avg.blue);
|
color_table[*index] = qRgb(this->avg.red, this->avg.green, this->avg.blue);
|
||||||
this->index = (*index)++;
|
this->index = (*index)++;
|
||||||
} else {
|
} else {
|
||||||
@ -220,9 +218,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (compute_parent_averages) {
|
if (compute_parent_averages) this->update_average();
|
||||||
this->avg.red = AVG_COLOR(red); this->avg.green = AVG_COLOR(green); this->avg.blue = AVG_COLOR(blue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user