#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 () | |
ctor () | |
Image () | |
virtual | ~Image () |
bool | initWithImageFile (const std::string &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 () |
var | getData () |
ssize_t | getDataLen () |
var | getDataLen () |
local | getDataLen () |
Format | getFileType () |
var | getFileType () |
local | getFileType () |
Texture2D::PixelFormat | getRenderFormat () |
int | getWidth () |
var | getWidth () |
local | getWidth () |
int | getHeight () |
var | getHeight () |
local | getHeight () |
bool | isPremultipliedAlpha () |
local | isPremultipliedAlpha () |
int | getNumberOfMipmaps () |
MipmapInfo * | getMipmaps () |
bool | hasPremultipliedAlpha () |
var | hasPremultipliedAlpha () |
local | hasPremultipliedAlpha () |
int | getBitPerPixel () |
bool | hasAlpha () |
var | hasAlpha () |
local | hasAlpha () |
bool | isCompressed () |
var | isCompressed () |
local | isCompressed () |
bool | saveToFile (const std::string &filename, bool isToRGB=true) |
Save Image data to the specified file, with specified format. More... | |
var | saveToFile ( var filename, var true) |
Save Image data to the specified file, with specified format. More... | |
local | saveToFile ( local filename, local 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 () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases 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) |
var | initWithJpgData ( var data, var dataLen) |
local | initWithJpgData ( local data, local dataLen) |
bool | initWithPngData (const unsigned char *data, ssize_t dataLen) |
var | initWithPngData ( var data, var dataLen) |
local | initWithPngData ( local data, local 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) |
var | initWithPVRData ( var data, var dataLen) |
local | initWithPVRData ( local data, local 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) |
var | initWithPVRv3Data ( var data, var dataLen) |
local | initWithPVRv3Data ( local data, local dataLen) |
bool | initWithETCData (const unsigned char *data, ssize_t dataLen) |
var | initWithETCData ( var data, var dataLen) |
local | initWithETCData ( local data, local dataLen) |
bool | initWithS3TCData (const unsigned char *data, ssize_t dataLen) |
var | initWithS3TCData ( var data, var dataLen) |
local | initWithS3TCData ( local data, local dataLen) |
bool | initWithATITCData (const unsigned char *data, ssize_t dataLen) |
var | initWithATITCData ( var data, var dataLen) |
local | initWithATITCData ( local data, local dataLen) |
bool | initWithTGAData (tImageTGA *tgaData) |
var | initWithTGAData ( var tgaData) |
local | initWithTGAData ( local tgaData) |
bool | saveImageToPNG (const std::string &filePath, bool isToRGB=true) |
var | saveImageToPNG ( var filePath, var true) |
local | saveImageToPNG ( local filePath, local true) |
bool | saveImageToJPG (const std::string &filePath) |
var | saveImageToJPG ( var filePath) |
local | saveImageToJPG ( local filePath) |
void | premultipliedAlpha () |
var | premultipliedAlpha () |
local | premultipliedAlpha () |
Image (const Image &rImg) | |
Image ( var rImg) | |
Image ( local rImg) | |
Image & | operator= (const Image &) |
var | operator= () |
local | operator= () |
bool | initWithImageFileThreadSafe (const std::string &fullpath) |
var | initWithImageFileThreadSafe ( var fullpath) |
local | initWithImageFileThreadSafe ( local fullpath) |
Format | detectFormat (const unsigned char *data, ssize_t dataLen) |
local | detectFormat ( local data, local dataLen) |
bool | isPng (const unsigned char *data, ssize_t dataLen) |
var | isPng ( var data, var dataLen) |
local | isPng ( local data, local dataLen) |
bool | isJpg (const unsigned char *data, ssize_t dataLen) |
var | isJpg ( var data, var dataLen) |
local | isJpg ( local data, local dataLen) |
bool | isTiff (const unsigned char *data, ssize_t dataLen) |
var | isTiff ( var data, var dataLen) |
local | isTiff ( local data, local dataLen) |
bool | isWebp (const unsigned char *data, ssize_t dataLen) |
var | isWebp ( var data, var dataLen) |
local | isWebp ( local data, local dataLen) |
bool | isPvr (const unsigned char *data, ssize_t dataLen) |
var | isPvr ( var data, var dataLen) |
local | isPvr ( local data, local dataLen) |
bool | isEtc (const unsigned char *data, ssize_t dataLen) |
var | isEtc ( var data, var dataLen) |
local | isEtc ( local data, local dataLen) |
bool | isS3TC (const unsigned char *data, ssize_t dataLen) |
var | isS3TC ( var data, var dataLen) |
local | isS3TC ( local data, local dataLen) |
bool | isATITC (const unsigned char *data, ssize_t dataLen) |
var | isATITC ( var data, var dataLen) |
local | isATITC ( local data, local dataLen) |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
Ref () | |
Constructor. More... | |
Protected Attributes | |
unsigned char * | _data |
ssize_t | _dataLen |
var | _dataLen |
local | _dataLen |
int | _width |
var | _width |
local | _width |
int | _height |
var | _height |
local | _height |
Format | _fileType |
var | _fileType |
local | _fileType |
Texture2D::PixelFormat | _renderFormat |
var | _renderFormat |
local | _renderFormat |
bool | _preMulti |
var | _preMulti |
local | _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... | |
local | _referenceCount |
count of references More... | |
Static Protected Attributes | |
static const int | MIPMAP_MAX = 16 |
Determine how many mipmaps can we have. More... | |
Friends | |
class | TextureCache |
|
protected |
|
protected |
|
protected |
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. |
|
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 |
|
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