Image.pkg 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. Image();
  17. ~Image();
  18. void FlipVertical();
  19. bool SaveBMP(const String fileName);
  20. bool SavePNG(const String fileName);
  21. bool SaveTGA(const String fileName);
  22. bool SaveJPG(const String fileName, int quality);
  23. int GetWidth() const;
  24. int GetHeight() const;
  25. unsigned GetComponents() const;
  26. bool IsCompressed() const;
  27. CompressedFormat GetCompressedFormat() const;
  28. unsigned GetNumCompressedLevels() const;
  29. CompressedLevel GetCompressedLevel(unsigned index) const;
  30. tolua_readonly tolua_property__get_set int width;
  31. tolua_readonly tolua_property__get_set int height;
  32. tolua_readonly tolua_property__get_set unsigned components;
  33. tolua_readonly tolua_property__is_set bool compressed;
  34. tolua_readonly tolua_property__get_set CompressedFormat compressedFormat;
  35. tolua_readonly tolua_property__get_set unsigned numCompressedLevels;
  36. };
  37. ${
  38. #define TOLUA_DISABLE_tolua_ResourceLuaAPI_Image_new00
  39. static int tolua_ResourceLuaAPI_Image_new00(lua_State* tolua_S)
  40. {
  41. return ToluaNewObject<Image>(tolua_S);
  42. }
  43. #define TOLUA_DISABLE_tolua_ResourceLuaAPI_Image_new00_local
  44. static int tolua_ResourceLuaAPI_Image_new00_local(lua_State* tolua_S)
  45. {
  46. return ToluaNewObjectGC<Image>(tolua_S);
  47. }
  48. $}