Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

PixelIterator.h

Go to the documentation of this file.
00001 #ifndef HEADER_PIXELITERATOR_H
00002 #define HEADER_PIXELITERATOR_H
00003 
00004 class SurfaceLock;
00005 
00006 #include "V2.h"
00007 #include "NoCopy.h"
00008 
00009 #include "SDL.h"
00010 
00011 /**
00012  * Iterator over surface pixels.
00013  */
00014 class PixelIterator : public NoCopy {
00015     private:
00016         SDL_Surface *m_surface;
00017         SurfaceLock *m_lock;
00018         Uint8 *m_p;
00019         Uint8 *m_end;
00020         Uint8 m_bpp;
00021     public:
00022         PixelIterator(SDL_Surface *surface);
00023         virtual ~PixelIterator();
00024         void setPos(const V2 &pos);
00025         inline bool isValid() const { return m_p < m_end; }
00026         inline void inc() { m_p += m_bpp; }
00027 
00028         bool isTransparent() const;
00029         SDL_Color getColor() const;
00030         Uint32 getPixel() const;
00031 
00032         void putColor(const SDL_Color &color);
00033         void putPixel(Uint32 pixel);
00034 };
00035 
00036 #endif

Generated on Wed Jun 1 09:54:31 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2