Merged qtest branch into trunk.

This commit is contained in:
leo
2013-08-09 04:57:18 +00:00
parent 3bb6b098c8
commit f11c97777a
307 changed files with 25195 additions and 26292 deletions
+23 -35
View File
@@ -1,7 +1,18 @@
#ifndef _IMAGE_H_
#define _IMAGE_H_
#include "typedefs.h"
// Image Options
//#define LC_IMAGE_PROGRESSIVE 0x1000
#define LC_IMAGE_TRANSPARENT 0x2000
//#define LC_IMAGE_HIGHCOLOR 0x4000
#define LC_IMAGE_MASK 0x7000
enum LC_IMAGE_FORMAT
{
LC_IMAGE_BMP,
LC_IMAGE_JPG,
LC_IMAGE_PNG
};
class Image
{
@@ -9,44 +20,21 @@ public:
Image();
virtual ~Image();
bool FileSave(lcFile& file, LC_IMAGE_OPTS* opts) const;
bool FileSave(const char* filename, LC_IMAGE_OPTS* opts) const;
bool FileLoad(lcFile& file);
bool FileLoad(const char* filename);
bool FileSave(lcMemFile& File, LC_IMAGE_FORMAT Format, bool Transparent) const;
bool FileSave(const char* FileName, LC_IMAGE_FORMAT Format, bool Transparent) const;
bool FileLoad(lcMemFile& File);
bool FileLoad(const char* FileName);
void Resize(int width, int height);
void Resize(int Width, int Height);
void ResizePow2();
void FromOpenGL(int width, int height);
void Allocate(int width, int height, bool alpha);
int Width() const
{ return m_nWidth; }
int Height() const
{ return m_nHeight; }
int Alpha() const
{ return m_bAlpha; }
unsigned char* GetData() const
{ return m_pData; }
protected:
void FromOpenGL(int Width, int Height);
void Allocate(int Width, int Height, bool Alpha);
void FreeData();
bool LoadJPG(lcFile& file);
bool LoadBMP(lcFile& file);
bool LoadPNG(lcFile& file);
bool LoadGIF(lcFile& file);
bool SaveJPG(lcFile& file, int quality, bool progressive) const;
bool SaveBMP(lcFile& file, bool quantize) const;
bool SavePNG(lcFile& file, bool transparent, bool interlaced, unsigned char* background) const;
bool SaveGIF(lcFile& file, bool transparent, bool interlaced, unsigned char* background) const;
int m_nWidth;
int m_nHeight;
bool m_bAlpha;
unsigned char* m_pData;
int mWidth;
int mHeight;
bool mAlpha;
unsigned char* mData;
};
void SaveVideo(char* filename, Image *images, int count, float fps);
#endif // _IMAGE_H_