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 )
Ogre::DDSCodec
-
- Gremlin
- Posts: 164
- Joined: Sun Apr 14, 2013 8:51 pm
- x 10
Re: Ogre::DDSCodec
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
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
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: Ogre::DDSCodec
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.
-
- Gnoblar
- Posts: 3
- Joined: Thu May 15, 2014 7:47 am
Re: Ogre::DDSCodec
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!!!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.
-
- Gnoblar
- Posts: 3
- Joined: Thu May 15, 2014 7:47 am
Re: Ogre::DDSCodec
'Thank a lot!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
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: Ogre::DDSCodec
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.
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.