Ogre::DDSCodec

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
cambridge
Gnoblar
Posts: 3
Joined: Thu May 15, 2014 7:47 am

Ogre::DDSCodec

Post by cambridge »

Recently,I start reading source code of OGRE,and now I have a question.

In class Ogre::DDSCodec,it has a public member function :
DataStreamPtr DDSCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
{
OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
"DDS encoding not supported",
"DDSCodec::code" ) ;
}
However,the following,it implement a public member function :

void DDSCodec::codeToFile(MemoryDataStreamPtr& input,
const String& outFileName, Codec::CodecDataPtr& pData) const
{
.....
}
Now that it does not support encoding dds, why it can support encoding to file?(Thanks for reading my pool english :lol: )
hydexon
Gremlin
Posts: 164
Joined: Sun Apr 14, 2013 8:51 pm
x 10

Re: Ogre::DDSCodec

Post by hydexon »

Here's is no implementation of that DDSCodec was implemented if your graphics hardware doesn't support DDS textures and must decoded by OGRE.
If you want enconding to DDS try this library: https://code.google.com/p/libsquish/ supports DXT1, DXT3 and DXT5 and has very simple interfaces, so is pretty straightforward to implement yourself
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Ogre::DDSCodec

Post by c6burns »

If you look at what that method does, it doesn't actually encode anything ... so yes the method name is a bit misleading. It simply takes a pointer to DDS data in memory and generates the file headers and then writes the data to disk.
cambridge
Gnoblar
Posts: 3
Joined: Thu May 15, 2014 7:47 am

Re: Ogre::DDSCodec

Post by cambridge »

c6burns wrote:If you look at what that method does, it doesn't actually encode anything ... so yes the method name is a bit misleading. It simply takes a pointer to DDS data in memory and generates the file headers and then writes the data to disk.
Oh,I thought those behaviour were encoding...By the way,where can I learn something like texture encoding and decoding?If there are some recomemded books,I would really appreciate!!!
cambridge
Gnoblar
Posts: 3
Joined: Thu May 15, 2014 7:47 am

Re: Ogre::DDSCodec

Post by cambridge »

hydexon wrote:Here's is no implementation of that DDSCodec was implemented if your graphics hardware doesn't support DDS textures and must decoded by OGRE.
If you want enconding to DDS try this library: https://code.google.com/p/libsquish/ supports DXT1, DXT3 and DXT5 and has very simple interfaces, so is pretty straightforward to implement yourself
'Thank a lot! :P :P
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Ogre::DDSCodec

Post by c6burns »

For DDS the specs are published:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

I don't know of any books that deal with encoding/decoding. freeimage is a good library to understand images, and is an optional dependency of OgreMain. libav is a really good library to better understand both the specifics of various codecs, and encoding/decoding in general ... though it's focused more on audio/video it deals with images as well.
Post Reply