can OgreImageCodec load dds format image?
Posted: Wed Aug 18, 2010 02:23
how to make OgreImageCodec load dds format image?
through operate bit, like FreeImageImageCodec.
through operate bit, like FreeImageImageCodec.
Code: Select all
for (uint i = 0; i < height; ++i)
{
for (uint j = 0; j < width; ++j)
{
uint p = *(((uint*)(rawBuf + i * pitch)) + j);
uint r = (p >> 16) & 0x000000FF;
uint b = (p << 16) & 0x00FF0000;
p &= 0xFF00FF00;
p |= r | b;
// write the adjusted pixel back
*(((uint*)(rawBuf + i * pitch)) + j) = p;
}
}