Image.pkg 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $#include "Image.h"
  2. enum CompressedFormat
  3. {
  4. CF_NONE = 0,
  5. CF_DXT1,
  6. CF_DXT3,
  7. CF_DXT5,
  8. CF_ETC1,
  9. CF_PVRTC_RGB_2BPP,
  10. CF_PVRTC_RGBA_2BPP,
  11. CF_PVRTC_RGB_4BPP,
  12. CF_PVRTC_RGBA_4BPP,
  13. };
  14. class Image : public Resource
  15. {
  16. void FlipVertical();
  17. bool SaveBMP(const char* fileName);
  18. bool SavePNG(const char* fileName);
  19. bool SaveTGA(const char* fileName);
  20. bool SaveJPG(const char* fileName, int quality);
  21. int GetWidth() const;
  22. int GetHeight() const;
  23. unsigned GetComponents() const;
  24. bool IsCompressed() const;
  25. CompressedFormat GetCompressedFormat() const;
  26. unsigned GetNumCompressedLevels() const;
  27. CompressedLevel GetCompressedLevel(unsigned index) const;
  28. tolua_readonly tolua_property__get_set int width;
  29. tolua_readonly tolua_property__get_set int height;
  30. tolua_readonly tolua_property__get_set unsigned components;
  31. tolua_readonly tolua_property__is_set bool compressed;
  32. tolua_readonly tolua_property__get_set CompressedFormat compressedFormat;
  33. tolua_readonly tolua_property__get_set unsigned numCompressedLevels;
  34. };