+ mapnik_png256_reduce.patch (Marcin Rudowski)
This commit is contained in:
parent
10481f8403
commit
760d82f511
1 changed files with 4 additions and 8 deletions
|
@ -64,6 +64,7 @@ namespace mapnik {
|
||||||
greens(0),
|
greens(0),
|
||||||
blues(0),
|
blues(0),
|
||||||
count(0),
|
count(0),
|
||||||
|
count2(0),
|
||||||
index(0)
|
index(0)
|
||||||
{
|
{
|
||||||
memset(&children_[0],0,sizeof(children_));
|
memset(&children_[0],0,sizeof(children_));
|
||||||
|
@ -82,20 +83,14 @@ namespace mapnik {
|
||||||
unsigned greens;
|
unsigned greens;
|
||||||
unsigned blues;
|
unsigned blues;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
|
unsigned count2;
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
};
|
};
|
||||||
struct node_cmp
|
struct node_cmp
|
||||||
{
|
{
|
||||||
bool operator() ( const node * lhs,const node* rhs) const
|
bool operator() ( const node * lhs,const node* rhs) const
|
||||||
{
|
{
|
||||||
unsigned left_total=0;
|
return lhs->count2 < rhs->count2;
|
||||||
unsigned right_total=0;
|
|
||||||
for (unsigned i=0; i<8;++i)
|
|
||||||
{
|
|
||||||
if (lhs->children_[i]) left_total+=lhs->children_[i]->count;
|
|
||||||
if (rhs->children_[i]) right_total+=rhs->children_[i]->count;
|
|
||||||
}
|
|
||||||
return left_total < right_total;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,6 +114,7 @@ namespace mapnik {
|
||||||
unsigned level = 0;
|
unsigned level = 0;
|
||||||
node * cur_node = root_;
|
node * cur_node = root_;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
cur_node->count2++;
|
||||||
|
|
||||||
if ( cur_node->count > 0 || level == leaf_level_)
|
if ( cur_node->count > 0 || level == leaf_level_)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue