fix std::sort and std::lower_bound usage

This commit is contained in:
Dane Springmeyer 2014-08-04 14:42:24 -07:00
parent 5134fdc0d3
commit d7c3d8f774

View file

@ -258,7 +258,7 @@ public:
// find closest match based on mean of r,g,b,a
std::vector<rgba>::const_iterator pit =
std::lower_bound(sorted_pal_, c, rgba::mean_sort_cmp());
std::lower_bound(sorted_pal_.begin(),sorted_pal_.end(), c, rgba::mean_sort_cmp());
ind = pit-sorted_pal_.begin();
if (ind == sorted_pal_.size())
ind--;
@ -331,7 +331,7 @@ public:
create_palette_rek(sorted_pal_, root_.get());
// sort palette for binary searching in quantization
std::sort(sorted_pal_, rgba::mean_sort_cmp());
std::sort(sorted_pal_.begin(), sorted_pal_.end(), rgba::mean_sort_cmp());
// returned palette is rearanged, so that colors with a<255 are at the begining
pal_remap_.resize(sorted_pal_.size());
palette.clear();