axmol/tools/tolua++/CCImage.pkg

61 lines
1.8 KiB
Plaintext
Raw Normal View History

2013-04-05 17:13:46 +08:00
class CCImage : public CCObject
{
CCImage();
~CCImage();
2013-07-26 13:50:10 +08:00
/*
2013-04-05 17:13:46 +08:00
typedef enum
{
kFmtJpg = 0,
kFmtPng,
kFmtTiff,
kFmtWebp,
kFmtRawData,
kFmtUnKnown
}EImageFormat;
typedef enum
{
kAlignCenter = 0x33, ///< Horizontal center and vertical center.
kAlignTop = 0x13, ///< Horizontal center and vertical top.
kAlignTopRight = 0x12, ///< Horizontal right and vertical top.
kAlignRight = 0x32, ///< Horizontal right and vertical center.
kAlignBottomRight = 0x22, ///< Horizontal right and vertical bottom.
kAlignBottom = 0x23, ///< Horizontal center and vertical bottom.
kAlignBottomLeft = 0x21, ///< Horizontal left and vertical bottom.
kAlignLeft = 0x31, ///< Horizontal left and vertical center.
kAlignTopLeft = 0x11, ///< Horizontal left and vertical top.
}ETextAlign;
2013-07-17 17:12:04 +08:00
typedef enum
{
kColorGray = 0,
kColorRGB,
}EColorType;
2013-04-05 17:13:46 +08:00
2013-07-17 17:12:04 +08:00
bool initWithImageFile(const char * strPath);
2013-04-05 17:13:46 +08:00
bool initWithImageData(void * pData,
int nDataLen,
int nWidth = 0,
int nHeight = 0,
int nBitsPerComponent = 8);
bool initWithString(
const char * pText,
int nWidth = 0,
int nHeight = 0,
ETextAlign eAlignMask = kAlignCenter,
const char * pFontName = 0,
int nSize = 0);
2013-07-26 13:50:10 +08:00
*/
2013-04-05 17:13:46 +08:00
unsigned char * getData();
int getDataLen();
bool hasAlpha();
bool isPremultipliedAlpha();
bool saveToFile(const char *pszFilePath, bool bIsToRGB = true);
2013-07-29 14:04:51 +08:00
int getWidth();
int getHeight();
int getBitPerPixel();
2013-04-05 17:13:46 +08:00
};