| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- $#include "Image.h"
- enum CompressedFormat
- {
- CF_NONE = 0,
- CF_DXT1,
- CF_DXT3,
- CF_DXT5,
- CF_ETC1,
- CF_PVRTC_RGB_2BPP,
- CF_PVRTC_RGBA_2BPP,
- CF_PVRTC_RGB_4BPP,
- CF_PVRTC_RGBA_4BPP,
- };
- class Image : public Resource
- {
- Image();
- ~Image();
-
- bool LoadColorLUT(Deserializer& source);
- tolua_outside bool ImageLoadColorLUT @ LoadColorLUT(const String& fileName);
- void FlipVertical();
- bool SaveBMP(const String fileName);
- bool SavePNG(const String fileName);
- bool SaveTGA(const String fileName);
- bool SaveJPG(const String fileName, int quality);
-
- int GetWidth() const;
- int GetHeight() const;
- int GetDepth() const;
- unsigned GetComponents() const;
- bool IsCompressed() const;
- CompressedFormat GetCompressedFormat() const;
- unsigned GetNumCompressedLevels() const;
- CompressedLevel GetCompressedLevel(unsigned index) const;
-
- tolua_readonly tolua_property__get_set int width;
- tolua_readonly tolua_property__get_set int height;
- tolua_readonly tolua_property__get_set int depth;
- tolua_readonly tolua_property__get_set unsigned components;
- tolua_readonly tolua_property__is_set bool compressed;
- tolua_readonly tolua_property__get_set CompressedFormat compressedFormat;
- tolua_readonly tolua_property__get_set unsigned numCompressedLevels;
- };
- ${
- #define TOLUA_DISABLE_tolua_ResourceLuaAPI_Image_new00
- static int tolua_ResourceLuaAPI_Image_new00(lua_State* tolua_S)
- {
- return ToluaNewObject<Image>(tolua_S);
- }
- #define TOLUA_DISABLE_tolua_ResourceLuaAPI_Image_new00_local
- static int tolua_ResourceLuaAPI_Image_new00_local(lua_State* tolua_S)
- {
- return ToluaNewObjectGC<Image>(tolua_S);
- }
- static bool ImageLoadColorLUT(Image* image, const String& fileName)
- {
- if (!image)
- return false;
- File file(image->GetContext());
- if (!file.Open(fileName, FILE_READ))
- return false;
- return image->LoadColorLUT(file);
- }
- $}
|