diff options
author | pixel <pixel> | 2007-04-07 16:45:40 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-04-07 16:45:40 +0000 |
commit | 8808ce89baa1edce4f13f9958ee78346587aa8b3 (patch) | |
tree | fab484d91d82c37dd56dd56e6b4bcb2ee6bd7c38 /include | |
parent | 60951108708def7987a4b270bc237dc7738cce42 (diff) |
Basic JPEG support - unworking.
Diffstat (limited to 'include')
-rw-r--r-- | include/Image.h | 32 |
1 files changed, 5 insertions, 27 deletions
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 <Color.h> 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; |