be more explicit about unsigned type for rgba_palette::quantize

This commit is contained in:
Dane Springmeyer 2012-10-30 16:55:06 -07:00
parent ee68734975
commit 82b15bdd68
2 changed files with 4 additions and 4 deletions

View file

@ -137,8 +137,8 @@ public:
const std::vector<rgb>& palette() const;
const std::vector<unsigned>& alphaTable() const;
unsigned quantize(rgba const& c) const;
inline unsigned quantize(unsigned const& c) const
unsigned char quantize(rgba const& c) const;
inline unsigned char quantize(unsigned const& c) const
{
rgba_hash_table::const_iterator it = color_hashmap_.find(c);
if (it != color_hashmap_.end())

View file

@ -75,9 +75,9 @@ bool rgba_palette::valid() const
}
// return color index in returned earlier palette
unsigned rgba_palette::quantize(rgba const& c) const
unsigned char rgba_palette::quantize(rgba const& c) const
{
unsigned index = 0;
unsigned char index = 0;
if (colors_ == 1) return index;
rgba_hash_table::iterator it = color_hashmap_.find(c);