Fix isColorNoAlpha, but leave it commented out.

This commit is contained in:
castano 2010-03-10 08:49:40 +00:00
parent 558f7970b1
commit 96f22f8cd4
2 changed files with 7 additions and 2 deletions

View File

@ -175,6 +175,7 @@ bool ColorBlock::isSingleColor() const
return true; return true;
} }
/*
/// Returns true if the block has a single color, ignoring transparent pixels. /// Returns true if the block has a single color, ignoring transparent pixels.
bool ColorBlock::isSingleColorNoAlpha() const bool ColorBlock::isSingleColorNoAlpha() const
{ {
@ -182,7 +183,10 @@ bool ColorBlock::isSingleColorNoAlpha() const
int i; int i;
for(i = 0; i < 16; i++) for(i = 0; i < 16; i++)
{ {
if (m_color[i].a != 0) c = m_color[i]; if (m_color[i].a != 0) {
c = m_color[i];
break;
}
} }
Color32 mask(0xFF, 0xFF, 0xFF, 0x00); Color32 mask(0xFF, 0xFF, 0xFF, 0x00);
@ -198,6 +202,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
return true; return true;
} }
*/
/// Count number of unique colors in this color block. /// Count number of unique colors in this color block.
uint ColorBlock::countUniqueColors() const uint ColorBlock::countUniqueColors() const

View File

@ -24,7 +24,7 @@ namespace nv
void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0 void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0
bool isSingleColor() const; bool isSingleColor() const;
bool isSingleColorNoAlpha() const; //bool isSingleColorNoAlpha() const;
uint countUniqueColors() const; uint countUniqueColors() const;
Color32 averageColor() const; Color32 averageColor() const;
bool hasAlpha() const; bool hasAlpha() const;