imgsynth2/cpixelformat.h

00001 
00009 #ifndef CPIXELFORMAT_H
00010 #define CPIXELFORMAT_H
00011 
00012 #include <fstream>
00013 #include <stdexcept>
00014 
00015 class CBitmap;
00016 
00025 class CPixelFormat
00026 {
00027   public:
00032     class PixelFormatError : public std::invalid_argument {
00033       public:
00043         PixelFormatError(const std::string& what)
00044           : std::invalid_argument(what)
00045         {}
00046     };
00047 
00057     CPixelFormat(CBitmap *bitmap)
00058       : m_bitmap(bitmap)
00059     {}
00060 
00070     virtual ~CPixelFormat()
00071     {};
00072 
00076     typedef struct
00077     {
00079       uint32_t red;
00081       uint32_t green;
00083       uint32_t blue;
00084     } RGBPIXEL;
00085 
00097     virtual void getPixel(RGBPIXEL& pixel, const uint32_t x, const uint32_t y) = 0;
00098 
00110     virtual void setPixel(const RGBPIXEL& pixel, const uint32_t x, const uint32_t y) = 0;
00111 
00121     virtual uint32_t getBitCount() = 0;
00122 
00132     virtual void getMaxColor(RGBPIXEL& pixel) = 0;
00133 
00134   protected:
00135     /* members */
00137     CBitmap *m_bitmap;
00138 };
00139 
00140 #endif
00141 
00142 /* vim: set et sw=2 ts=2: */

Generated on Sun May 3 19:16:26 2009 for imgsynth2 by  doxygen 1.5.3