00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _image_h
00018 #define _image_h
00019
00020 #include <spl/types.h>
00021 #include <spl/Debug.h>
00022 #include <spl/Memory.h>
00023
00033 class Image : public IMemoryValidate
00034 {
00035 private:
00036
00037 inline Image(const Image& i) {}
00038 inline void operator =(const Image& i) {}
00039
00040 protected:
00041 byte *m_pixels;
00042 int m_w, m_h;
00043 int m_depth, m_bpp;
00044 unsigned int m_rmask, m_gmask, m_bmask, m_amask;
00045 unsigned int m_red[256], m_green[256], m_blue[256], m_alpha[256];
00046
00047 public:
00048 Image();
00049 virtual ~Image();
00050
00051 byte *Pixels() { return m_pixels; }
00052 int Depth() { return m_depth; }
00053 int Bbp() { return m_bpp; }
00054 int Width() { return m_w; }
00055 int Height() { return m_h; }
00056 unsigned int RMask() { return m_rmask; }
00057 unsigned int GMask() { return m_gmask; }
00058 unsigned int BMask() { return m_bmask; }
00059 unsigned int AMask() { return m_amask; }
00060 unsigned int *PRed() { return m_red; }
00061 unsigned int *PGreen() { return m_green; }
00062 unsigned int *PBlue() { return m_blue; }
00063 unsigned int *PAlpha() { return m_alpha; }
00064
00066 static Image *GetImage( const char *filename );
00067
00068 #ifdef DEBUG
00069 virtual void ValidateMem () const;
00070 virtual void CheckMem () const;
00071 #endif
00072 };
00073
00076 #endif