#include <CCImage.h>
Public Types | |
| enum | Format { JPG, PNG, TIFF, WEBP, PVR, ETC, S3TC, ATITC, TGA, RAW_DATA, UNKOWN } |
| Supported formats for Image. More... | |
Public Member Functions | |
| Image () | |
| virtual | ~Image () |
| bool | initWithImageFile (const std::string &path) |
| Load the image from the specified path. More... | |
| var | initWithImageFile ( var path) |
| Load the image from the specified path. More... | |
| local | initWithImageFile ( local path) |
| Load the image from the specified path. More... | |
| bool | initWithImageData (const unsigned char *data, ssize_t dataLen) |
| Load image from stream buffer. More... | |
| bool | initWithRawData (const unsigned char *data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti=false) |
| unsigned char * | getData () |
| ssize_t | getDataLen () |
| Format | getFileType () |
| Texture2D::PixelFormat | getRenderFormat () |
| local | getRenderFormat () |
| int | getWidth () |
| int | getHeight () |
| bool | isPremultipliedAlpha () |
| var | isPremultipliedAlpha () |
| local | isPremultipliedAlpha () |
| int | getNumberOfMipmaps () |
| MipmapInfo * | getMipmaps () |
| bool | hasPremultipliedAlpha () |
| local | hasPremultipliedAlpha () |
| int | getBitPerPixel () |
| bool | hasAlpha () |
| bool | isCompressed () |
| bool | saveToFile (const std::string &filename, bool isToRGB=true) |
| Save Image data to the specified file, with specified format. More... | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| void | release () |
| Release the ownership immediately. More... | |
| local | release () |
| Release the ownership immediately. More... | |
| Ref * | autorelease () |
| Release the ownership sometime soon automatically. More... | |
| unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
Protected Types | |
| typedef struct sImageTGA | tImageTGA |
Protected Member Functions | |
| bool | initWithJpgData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithPngData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithTiffData (const unsigned char *data, ssize_t dataLen) |
| local | initWithTiffData ( local data, local dataLen) |
| bool | initWithWebpData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithPVRData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithPVRv2Data (const unsigned char *data, ssize_t dataLen) |
| local | initWithPVRv2Data ( local data, local dataLen) |
| bool | initWithPVRv3Data (const unsigned char *data, ssize_t dataLen) |
| bool | initWithETCData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithS3TCData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithATITCData (const unsigned char *data, ssize_t dataLen) |
| bool | initWithTGAData (tImageTGA *tgaData) |
| bool | saveImageToPNG (const std::string &filePath, bool isToRGB=true) |
| bool | saveImageToJPG (const std::string &filePath) |
| Image (const Image &rImg) | |
| Image & | operator= (const Image &) |
| bool | initWithImageFileThreadSafe (const std::string &fullpath) |
| local | initWithImageFileThreadSafe ( local fullpath) |
| Format | detectFormat (const unsigned char *data, ssize_t dataLen) |
| bool | isPng (const unsigned char *data, ssize_t dataLen) |
| bool | isJpg (const unsigned char *data, ssize_t dataLen) |
| bool | isTiff (const unsigned char *data, ssize_t dataLen) |
| bool | isWebp (const unsigned char *data, ssize_t dataLen) |
| bool | isPvr (const unsigned char *data, ssize_t dataLen) |
| bool | isEtc (const unsigned char *data, ssize_t dataLen) |
| bool | isS3TC (const unsigned char *data, ssize_t dataLen) |
| bool | isATITC (const unsigned char *data, ssize_t dataLen) |
Protected Member Functions inherited from Ref | |
| Ref () | |
| Constructor. More... | |
| Ref () | |
| Constructor. More... | |
Protected Attributes | |
| unsigned char * | _data |
| var | _data |
| local | _data |
| ssize_t | _dataLen |
| var | _dataLen |
| local | _dataLen |
| int | _width |
| int | _height |
| var | _height |
| local | _height |
| Format | _fileType |
| var | _fileType |
| local | _fileType |
| Texture2D::PixelFormat | _renderFormat |
| var | _renderFormat |
| local | _renderFormat |
| bool | _preMulti |
| MipmapInfo | _mipmaps [MIPMAP_MAX] |
| var | _mipmaps () |
| local | _mipmaps () |
| int | _numberOfMipmaps |
| var | _numberOfMipmaps |
| local | _numberOfMipmaps |
| bool | _hasPremultipliedAlpha |
| var | _hasPremultipliedAlpha |
| local | _hasPremultipliedAlpha |
| std::string | _filePath |
| var | _filePath |
| local | _filePath |
Protected Attributes inherited from Ref | |
| unsigned int | _referenceCount |
| count of references More... | |
Static Protected Attributes | |
| static const int | MIPMAP_MAX = 16 |
| Determine how many mipmaps can we have. More... | |
| local | MIPMAP_MAX = 16 |
| Determine how many mipmaps can we have. More... | |
Friends | |
| class | TextureCache |
|
protected |
|
protected |
|
protected |
|
strong |
|
strong |
|
strong |
| Image | ( | ) |
| var ctor | ( | ) |
| local Image | ( | ) |
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
| int getBitPerPixel | ( | ) |
| var getBitPerPixel | ( | ) |
| local getBitPerPixel | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool hasAlpha | ( | ) |
| var hasAlpha | ( | ) |
| local hasAlpha | ( | ) |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool initWithImageData | ( | const unsigned char * | data, |
| ssize_t | dataLen | ||
| ) |
Load image from stream buffer.
| data | stream buffer which holds the image data. |
| dataLen | data length expressed in (number of) bytes. |
| bool initWithImageFile | ( | const std::string & | path) |
Load the image from the specified path.
| path | the absolute file path. |
| var initWithImageFile | ( | var | path) |
Load the image from the specified path.
| path | the absolute file path. |
| local initWithImageFile | ( | local | path) |
Load the image from the specified path.
| path | the absolute file path. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool initWithRawData | ( | const unsigned char * | data, |
| ssize_t | dataLen, | ||
| int | width, | ||
| int | height, | ||
| int | bitsPerComponent, | ||
| bool | preMulti = false |
||
| ) |
| var initWithRawData | ( | var | data, |
| var | dataLen, | ||
| var | width, | ||
| var | height, | ||
| var | bitsPerComponent, | ||
| var | preMulti = false |
||
| ) |
| local initWithRawData | ( | local | data, |
| local | dataLen, | ||
| local | width, | ||
| local | height, | ||
| local | bitsPerComponent, | ||
| local | preMulti = false |
||
| ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool isCompressed | ( | ) |
| var isCompressed | ( | ) |
| local isCompressed | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool saveToFile | ( | const std::string & | filename, |
| bool | isToRGB = true |
||
| ) |
Save Image data to the specified file, with specified format.
| filePath | the file's absolute path, including file suffix. |
| isToRGB | whether the image is saved as RGB format. |
| var saveToFile | ( | var | filename, |
| var | isToRGB = true |
||
| ) |
Save Image data to the specified file, with specified format.
| filePath | the file's absolute path, including file suffix. |
| isToRGB | whether the image is saved as RGB format. |
| local saveToFile | ( | local | filename, |
| local | isToRGB = true |
||
| ) |
Save Image data to the specified file, with specified format.
| filePath | the file's absolute path, including file suffix. |
| isToRGB | whether the image is saved as RGB format. |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
Determine how many mipmaps can we have.
Its same as define but it respects namespaces
|
staticprotected |
Determine how many mipmaps can we have.
Its same as define but it respects namespaces
|
staticprotected |
Determine how many mipmaps can we have.
Its same as define but it respects namespaces