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

Function PreMult

DevIL/src-IL/src/il_dds-save.cpp:1223–1243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221
1222
1223void PreMult(ILushort *Data, ILubyte *Alpha)
1224{
1225 Color888 Colour;
1226 ILuint i;
1227
1228 for (i = 0; i < 16; i++) {
1229 ShortToColor888(Data[i], &Colour);
1230 Colour.r = (ILubyte)(((ILuint)Colour.r * Alpha[i]) >> 8);
1231 Colour.g = (ILubyte)(((ILuint)Colour.g * Alpha[i]) >> 8);
1232 Colour.b = (ILubyte)(((ILuint)Colour.b * Alpha[i]) >> 8);
1233
1234 /*Colour.r = (ILubyte)(Colour.r * (Alpha[i] / 255.0));
1235 Colour.g = (ILubyte)(Colour.g * (Alpha[i] / 255.0));
1236 Colour.b = (ILubyte)(Colour.b * (Alpha[i] / 255.0));*/
1237
1238 Data[i] = Color888ToShort(&Colour);
1239 ShortToColor888(Data[i], &Colour);
1240 }
1241
1242 return;
1243}
1244
1245
1246//! Compresses data to a DXT format using different methods.

Callers

nothing calls this directly

Calls 2

ShortToColor888Function · 0.85
Color888ToShortFunction · 0.85

Tested by

no test coverage detected