From 2f052f299c05b2078b6471d18b09ad67d327a411 Mon Sep 17 00:00:00 2001 From: Ming Date: Mon, 26 Jul 2010 10:18:46 +0000 Subject: [PATCH] issue #6: add function getRGBA8888Data() --- cocos2dx/platform/uphone/UIImage.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cocos2dx/platform/uphone/UIImage.h b/cocos2dx/platform/uphone/UIImage.h index e51cd0a847..99caaf5666 100644 --- a/cocos2dx/platform/uphone/UIImage.h +++ b/cocos2dx/platform/uphone/UIImage.h @@ -34,22 +34,25 @@ class UIImage { public: UIImage(void); - UIImage(INT32 nX, INT32 nY, void *buffer); + UIImage(int nX, int nY, void *buffer); ~UIImage(void); 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 save(const std::string &strFileName, INT32 nFormat); + bool save(const std::string &strFileName, int nFormat); UINT32 width(void); UINT32 height(void); bool isAlphaPixelFormat(void); - INT32 CGImageGetBitsPerComponent(void); - INT32 CGImageGetColorSpace(void); + int CGImageGetBitsPerComponent(void); + int CGImageGetColorSpace(void); + + // convert the bitmap to 256 pixel format, and every component is 8 bits + UINT8* getRGBA8888Data(void); private: TBitmap *m_pBitmap; };