From 8808ce89baa1edce4f13f9958ee78346587aa8b3 Mon Sep 17 00:00:00 2001 From: pixel Date: Sat, 7 Apr 2007 16:45:40 +0000 Subject: Basic JPEG support - unworking. --- include/Image.h | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/Image.h b/include/Image.h index 633ab55..55e96a5 100644 --- a/include/Image.h +++ b/include/Image.h @@ -6,45 +6,23 @@ #include enum { - FORMAT_TGA_BASIC + FORMAT_TGA_BASIC, + FORMAT_JPEG, }; class Image : public Buffer { public: - Image(unsigned int, unsigned int); + Image(unsigned int width, unsigned int height); virtual ~Image(); Color GetPixel(unsigned int, unsigned int) const; + unsigned char * GetBuffer(); void SetPixel(unsigned int, unsigned int, Color); - bool Prepare(unsigned int = FORMAT_TGA_BASIC); + bool Prepare(unsigned int = FORMAT_TGA_BASIC) throw (GeneralException); void Fill(Color = Color(0, 0, 0)); virtual String GetName() const; virtual bool CanWrite() const; private: - typedef unsigned char Byte; - typedef unsigned short int Word; - typedef unsigned long int DWord; - struct TGAHeader { - Byte IDLength; - Byte ColorMapType; - Byte ImageType; - Word CM_FirstEntry; - Word CM_Length; - Byte CM_EntrySize; - Word IS_XOrigin; - Word IS_YOrigin; - Word IS_Width; - Word IS_Height; - Byte IS_Depth; - Byte IS_Descriptor; - } PACKED; - - struct TGAFooter { - DWord ExtOffset; - DWord DevOffset; - char Sig[18]; - } PACKED; - unsigned int x, y; bool r; Color * img; -- cgit v1.2.3