CImageLoaderTEX.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. // this file was created by rt (www.tomkorp.com), based on ttk's png-reader
  5. // i wanted to be able to read in PNG images with irrlicht :)
  6. // why? lossless compression with 8-bit alpha channel!
  7. #ifndef __C_IMAGE_LOADER_TEX_H_INCLUDED__
  8. #define __C_IMAGE_LOADER_PNG_H_INCLUDED__
  9. #include <irrlicht/irrlicht.h>
  10. namespace irr
  11. {
  12. namespace video
  13. {
  14. //! Surface Loader for PNG files
  15. class CImageLoaderTex : public IImageLoader
  16. {
  17. public:
  18. //! returns true if the file maybe is able to be loaded by this class
  19. //! based on the file extension (e.g. ".png")
  20. virtual bool isALoadableFileExtension(const io::path& filename) const;
  21. //! returns true if the file maybe is able to be loaded by this class
  22. virtual bool isALoadableFileFormat(io::IReadFile* file) const;
  23. //! creates a surface from the file
  24. virtual IImage* loadImage(io::IReadFile* input) const;
  25. private:
  26. enum TextureFormat
  27. {
  28. ARGB8888,
  29. RA88,
  30. A8,
  31. DXT5,
  32. DXT3,
  33. DXT1
  34. };
  35. };
  36. } // end namespace video
  37. } // end namespace irr
  38. #endif