MCPcopy Create free account
hub / github.com/DentonW/DevIL / CorrectPreMult

Function CorrectPreMult

DevIL/src-IL/src/il_dds.cpp:1668–1681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1666
1667
1668void CorrectPreMult()
1669{
1670 ILuint i;
1671
1672 for (i = 0; i < Image->SizeOfData; i += 4) {
1673 if (Image->Data[i+3] != 0) { // Cannot divide by 0.
1674 Image->Data[i] = (ILubyte)(((ILuint)Image->Data[i] << 8) / Image->Data[i+3]);
1675 Image->Data[i+1] = (ILubyte)(((ILuint)Image->Data[i+1] << 8) / Image->Data[i+3]);
1676 Image->Data[i+2] = (ILubyte)(((ILuint)Image->Data[i+2] << 8) / Image->Data[i+3]);
1677 }
1678 }
1679
1680 return;
1681}
1682
1683
1684ILboolean DecompressARGB(ILuint CompFormat)

Callers 2

DecompressDXT2Function · 0.85
DecompressDXT4Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected