Apply singlecolorpatch.diff from Amir Ebrahimi.

Add single color compressor to CUDA implementation.
This commit is contained in:
castano
2008-02-16 09:53:07 +00:00
parent eb36ef86a7
commit b41752aa84
8 changed files with 110 additions and 19 deletions

View File

@ -110,6 +110,19 @@ void ColorBlock::splatY()
}
}
/// Returns true if the block has a single color.
bool ColorBlock::isSingleColor() const
{
for(int i = 1; i < 16; i++)
{
if (m_color[0] != 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 splatX();
void splatY();
bool isSingleColor() const;
uint countUniqueColors() const;
Color32 averageColor() const;
bool hasAlpha() const;