00001 #ifndef IMAGE_H 00002 #define IMAGE_H 00003 00004 00005 #include <string> 00006 00007 00008 class RGBAColor; 00009 00010 00016 class Image 00017 { 00018 public: 00024 Image(int resX, int resY); 00025 00028 virtual ~Image(); 00029 00032 int width() const 00033 { 00034 return mResX; 00035 } 00036 00039 int height() const 00040 { 00041 return mResY; 00042 } 00043 00046 const RGBAColor & pixel(int x, int y) const; 00047 00050 void setPixel(const RGBAColor & p, int x, int y); 00051 00057 virtual bool read(const std::string & fileName) = 0; 00058 00063 virtual void write(const std::string & fileName) const = 0; 00064 00065 protected: 00067 int mResX; 00068 00070 int mResY; 00071 00073 RGBAColor * mPixels; 00074 }; 00075 00076 00077 #endif 00078