QGearsTexCodec.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. -----------------------------------------------------------------------------
  3. The MIT License (MIT)
  4. Copyright (c) 2013-07-30 Tobias Peters <tobias.peters@kreativeffekt.at>
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. -----------------------------------------------------------------------------
  21. */
  22. #ifndef __QGearsTexCodec_H__
  23. #define __QGearsTexCodec_H__
  24. #include <OgreImageCodec.h>
  25. #include <OgreCodec.h>
  26. #include "QGearsPrerequisites.h"
  27. namespace QGears
  28. {
  29. class _QGearsExport TexCodec : public Ogre::ImageCodec
  30. {
  31. public:
  32. TexCodec();
  33. virtual ~TexCodec();
  34. /// @copydoc Ogre::ImageCodec::getType
  35. virtual Ogre::String getType() const;
  36. virtual Ogre::DataStreamPtr encode(Ogre::MemoryDataStreamPtr& input, CodecDataPtr& pData) const final;
  37. virtual void encodeToFile(Ogre::MemoryDataStreamPtr& input, const Ogre::String& outFileName, CodecDataPtr& pData) const final;
  38. /// @copydoc Ogre::Codec::decode
  39. Ogre::Codec::DecodeResult decode( Ogre::DataStreamPtr& input ) const;
  40. /// @copydoc Ogre::Codec::magicNumberToFileExt
  41. virtual Ogre::String magicNumberToFileExt(const char *magicNumberPtr, size_t maxbytes) const;
  42. static Ogre::String ms_type_name;
  43. /// @copydoc Ogre::Plugin::install
  44. static void install();
  45. /// @copydoc Ogre::Plugin::initialise
  46. static void initialise();
  47. /// @copydoc Ogre::Plugin::shutdown
  48. static void shutdown();
  49. /// @copydoc Ogre::Plugin::uninstall
  50. static void uninstall();
  51. private:
  52. static TexCodec *ms_tex_codex;
  53. };
  54. }
  55. #endif // __QGearsTexCodec_H__