can OgreImageCodec load dds format image?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

can OgreImageCodec load dds format image?

Postby wang37921 » Wed Aug 18, 2010 02:23

how to make OgreImageCodec load dds format image?
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;
            }
        }

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: can OgreImageCodec load dds format image?

Postby CrazyEddie » Sun Aug 22, 2010 09:42

This is not really supported at the moment, due to the fact that, internally, CEGUI only supports RGB and RGBA uncompressed formats, so while the Ogre based ImageCodec should be able to load and parse the dds file ok, when the resulting data gets passed back to CEGUI it is rejected as being in an unsupported format.

There is some work going on in this area and, one way or another, such support should be available from the 0.8.0 release (but that will not be available until some time next year)

CE.

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

Re: can OgreImageCodec load dds format image?

Postby wang37921 » Mon Aug 23, 2010 06:48

If I use compressed format(e.g. dds) force and cheat ce's code, like
"case DDS:
case ARGB:
...
", will be punished? --->crash? :oops:
that is, i want to know has ce's code operation texture byte information.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: can OgreImageCodec load dds format image?

Postby CrazyEddie » Tue Aug 24, 2010 08:39

No, as far as I remember (without looking at a lot of code!), we do not access texture data directly within CEGUI, so to hack it in, it's literally just a case of adding some new cases for alternative formats (done correctly we need detection on various platforms and APIs, so that's why it's not there yet, but it will be coming).

So, yes, give that code a try, because either that - or something similar (you need the texture where the data is transferred to be the same format, I think) - should work with a bit of playing around. I don't think it would crash, but you might not get the right imagery ;)

CE


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests