123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef __SUPPORT_DATA_SUPPORT_TGALIB_H__
- #define __SUPPORT_DATA_SUPPORT_TGALIB_H__
- namespace cocos2d {
- enum {
- TGA_OK,
- TGA_ERROR_FILE_OPEN,
- TGA_ERROR_READING_FILE,
- TGA_ERROR_INDEXED_COLOR,
- TGA_ERROR_MEMORY,
- TGA_ERROR_COMPRESSED_FILE,
- };
- typedef struct sImageTGA {
- int status;
- unsigned char type, pixelDepth;
-
-
- signed short width;
-
-
- signed short height;
-
-
- unsigned char *imageData;
- int flipped;
- } tImageTGA;
- bool tgaLoadHeader(unsigned char *buffer, unsigned long bufSize, tImageTGA *info);
- bool tgaLoadImageData(unsigned char *buffer, unsigned long bufSize, tImageTGA *info);
- tImageTGA* tgaLoadBuffer(unsigned char* buffer, long size);
- tImageTGA * tgaLoad(const char *filename);
- void tgaRGBtogreyscale(tImageTGA *info);
- void tgaDestroy(tImageTGA *info);
- }
- #endif
|