GenerateRLE8.h
Go to the documentation of this file.00001 00011 #ifndef __GenerateRLE8_H__ 00012 #define __GenerateRLE8_H__ 00013 00014 // Includes 00015 00016 // Forward declares 00017 class Image; 00018 class Bitmap_RLE8; 00019 00020 // GenerateRLE8 00021 class GenerateRLE8 00022 { 00023 public: 00024 GenerateRLE8(const Image& image, Bitmap_RLE8* bitmap, bool dither); 00025 00026 private: 00027 void CreateFromImage(const Image* image, bool dither); 00028 int GetRLESize(unsigned char* data,unsigned char* mask); 00029 int GetRunLength(unsigned char* data, unsigned char* mask,int size); 00030 int GetUniquesLength(unsigned char* data, unsigned char* mask,int size); 00031 int CreateRLE(unsigned char* source, unsigned char* mask, unsigned char* destination); 00032 int GetRLESize_Alpha(unsigned char* data,unsigned char* mask); 00033 int GetRunLength_Alpha(unsigned char* data, unsigned char* mask,int size); 00034 int GetUniquesLength_Alpha(unsigned char* data, unsigned char* mask,int size); 00035 int CreateRLE_Alpha(unsigned char* source, unsigned char* mask, unsigned char* destination); 00036 void Palettize(const Image* image,unsigned char** data, unsigned char** mask, unsigned short** palette, unsigned char* colorCount, bool dither); 00037 void Crop(const Image* image, int* minX, int* minY, int* maxX, int* maxY); 00038 00039 private: 00040 unsigned char usesMask_; 00041 unsigned short xOffset_; 00042 unsigned short yOffset_; 00043 unsigned short activeWidth_; // Width of sprite 00044 unsigned short activeHeight_; // Height of sprite 00045 unsigned short width_; // Width of sprite 00046 unsigned short height_; // Height of sprite 00047 unsigned int opaqueSize_; 00048 unsigned char* opaqueData_; 00049 unsigned int alphaSize_; 00050 unsigned char* alphaData_; 00051 unsigned char colorCount_; // Number of colors in palette 00052 unsigned short* palette_; // Maximum of 256 colors 00053 }; 00054 00055 00056 #endif /* __GenerateRLE8_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
