Remove legacy compressors.

Add iteration count parameter to iterative alpha compressor.
Add optimal compressors.
This commit is contained in:
castano
2008-04-26 08:02:30 +00:00
parent e3f7e303e4
commit 921ee354c0
9 changed files with 81 additions and 791 deletions

View File

@ -125,6 +125,27 @@ bool ColorBlock::isSingleColor() const
return true;
}
/// Returns true if the block has a single color, ignoring transparent pixels.
bool ColorBlock::isSingleColorNoAlpha() const
{
Color32 c;
int i;
for(i = 0; i < 16; i++)
{
if (m_color[i].a != 0) c = m_color[i];
}
for(; i < 16; i++)
{
if (c != m_color[i])
{
return false;
}
}
return true;
}
/// Count number of unique colors in this color block.
uint ColorBlock::countUniqueColors() const
{

View File

@ -24,6 +24,7 @@ namespace nv
void splatY();
bool isSingleColor() const;
bool isSingleColorNoAlpha() const;
uint countUniqueColors() const;
Color32 averageColor() const;
bool hasAlpha() const;