diff options
author | pixel <pixel> | 2002-11-29 20:39:44 +0000 |
---|---|---|
committer | pixel <pixel> | 2002-11-29 20:39:44 +0000 |
commit | ed0ed93bc9a64412c04a73938b04079cad95c4af (patch) | |
tree | 985cbfc9e800d0ee6d28ebb542d6ee79c9a4cc96 /include/Image.h | |
parent | a69ef2131749e05bb43106d48139638de0144f69 (diff) |
Yeah... reworking on it!
Diffstat (limited to 'include/Image.h')
-rw-r--r-- | include/Image.h | 20 |
1 files changed, 8 insertions, 12 deletions
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 <Buffer.h> +#include <generic.h> +#include <Color.h> 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; |