be more explicit about unsigned type for rgba_palette::quantize
This commit is contained in:
parent
ee68734975
commit
82b15bdd68
2 changed files with 4 additions and 4 deletions
|
@ -137,8 +137,8 @@ public:
|
||||||
const std::vector<rgb>& palette() const;
|
const std::vector<rgb>& palette() const;
|
||||||
const std::vector<unsigned>& alphaTable() const;
|
const std::vector<unsigned>& alphaTable() const;
|
||||||
|
|
||||||
unsigned quantize(rgba const& c) const;
|
unsigned char quantize(rgba const& c) const;
|
||||||
inline unsigned quantize(unsigned const& c) const
|
inline unsigned char quantize(unsigned const& c) const
|
||||||
{
|
{
|
||||||
rgba_hash_table::const_iterator it = color_hashmap_.find(c);
|
rgba_hash_table::const_iterator it = color_hashmap_.find(c);
|
||||||
if (it != color_hashmap_.end())
|
if (it != color_hashmap_.end())
|
||||||
|
|
|
@ -75,9 +75,9 @@ bool rgba_palette::valid() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// return color index in returned earlier palette
|
// 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;
|
if (colors_ == 1) return index;
|
||||||
|
|
||||||
rgba_hash_table::iterator it = color_hashmap_.find(c);
|
rgba_hash_table::iterator it = color_hashmap_.find(c);
|
||||||
|
|
Loading…
Reference in a new issue