issue #6: add function getRGBA8888Data()

This commit is contained in:
Ming 2010-07-26 10:18:46 +00:00
parent 245a8de096
commit 2f052f299c
1 changed files with 8 additions and 5 deletions

View File

@ -34,22 +34,25 @@ class UIImage
{ {
public: public:
UIImage(void); UIImage(void);
UIImage(INT32 nX, INT32 nY, void *buffer); UIImage(int nX, int nY, void *buffer);
~UIImage(void); ~UIImage(void);
bool initWithContentsOfFile(const std::string &strPath); bool initWithContentsOfFile(const std::string &strPath);
bool initWithBuffer(INT32 nX, INT32 nY, unsigned char *pBuffer); bool initWithBuffer(int nX, int nY, unsigned char *pBuffer);
// bool initWithCGImage(CGImageRef pCGImage); // bool initWithCGImage(CGImageRef pCGImage);
bool save(const std::string &strFileName, INT32 nFormat); bool save(const std::string &strFileName, int nFormat);
UINT32 width(void); UINT32 width(void);
UINT32 height(void); UINT32 height(void);
bool isAlphaPixelFormat(void); bool isAlphaPixelFormat(void);
INT32 CGImageGetBitsPerComponent(void); int CGImageGetBitsPerComponent(void);
INT32 CGImageGetColorSpace(void); int CGImageGetColorSpace(void);
// convert the bitmap to 256 pixel format, and every component is 8 bits
UINT8* getRGBA8888Data(void);
private: private:
TBitmap *m_pBitmap; TBitmap *m_pBitmap;
}; };