summaryrefslogtreecommitdiff
path: root/include/Image.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/Image.h')
-rw-r--r--include/Image.h32
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;