From ed0ed93bc9a64412c04a73938b04079cad95c4af Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 29 Nov 2002 20:39:44 +0000 Subject: Yeah... reworking on it! --- include/Image.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'include/Image.h') diff --git a/include/Image.h b/include/Image.h index 8fd719c..87a8ddd 100644 --- a/include/Image.h +++ b/include/Image.h @@ -3,27 +3,23 @@ #ifdef __cplusplus #include +#include +#include enum { - FORMAT_TGA_BASIC, -} format_t; - -struct Color { - Color(unsigned char aR, unsigned char aG, unsigned char aB, unsigned char aA = 255) : - R(aR), G(aG), B(aB), A(aA) { } - unsigned char R, G, B, A; + FORMAT_TGA_BASIC }; class Image : public Buffer { public: Image(unsigned int, unsigned int); virtual ~Image(); - Color GetPixel(unsigned int, unsigned int); + Color GetPixel(unsigned int, unsigned int) const; void SetPixel(unsigned int, unsigned int, Color); bool Prepare(unsigned int = FORMAT_TGA_BASIC); void Fill(Color = Color(0, 0, 0)); - virtual String GetName(); - virtual bool CanWrite(); + virtual String GetName() const; + virtual bool CanWrite() const; private: typedef unsigned char Byte; @@ -42,13 +38,13 @@ class Image : public Buffer { Word IS_Height; Byte IS_Depth; Byte IS_Descriptor; - } __attribute__((packed)); + } PACKED; struct TGAFooter { DWord ExtOffset; DWord DevOffset; char Sig[18]; - } __attribute__((packed)); + } PACKED; unsigned int x, y; bool r; -- cgit v1.2.3