Wavelet and Image class library  1.3.2
ColorImage.hh
Go to the documentation of this file.
00001 /*
00002  * class ColorImage
00003  *
00004  * $Date$
00005  * $Revision$
00006  *
00007  */
00008 
00009 #ifndef COLOR_IMAGE_HH__
00010 #define COLOR_IMAGE_HH__
00011 
00012 #include "WImage/Image.hh"
00013 #include "WImage/ColorBuffer.hh"
00014 
00024 class
00025 ColorImage : public ColorBuffer
00026 {
00027 public:
00041   ColorImage (int colors = 3, clrmodel cmodel = cm_rgb,
00042               Image **images = NULL, bool isReference = false,
00043               bool isMine = false);
00054   ColorImage (int rows, int cols, int colors = 3, clrmodel cmodel = cm_rgb);
00055 
00057   virtual ~ColorImage (void);
00058 
00064   inline Image &channel (int num) { return *m_images[num]; }
00065 
00071   inline const Image &channel (int num) const { return *m_images[num]; }
00072 
00073 #ifndef _WIN32_WCE
00074 
00081   void read (char const *fname);
00091   void read (char const *fname, filetype ftype);
00092 
00105   void write (char const *fname, bool beautify = false);
00114   void write (char const *fname, filetype ftype, bool beautify = false);
00115 #endif
00116 
00120   Image *averageImage (void);
00121 
00137   virtual void beautify (int yoffs = 0, int xoffs = 0,
00138                          int ysize = 0, int xsize = 0);
00139 
00142   ColorImage *clone (void) const;
00148   virtual void copy (ColorImage &img);
00149 
00152   inline int quality (void)  const{ return m_quality; }
00153 
00156   inline void quality (int quality)  { m_quality = quality; }
00157 
00169   ColorImage *crop (int yoffs, int xoffs, int ysize, int xsize) const;
00179   virtual void paste (int yoffs, int xoffs, ColorImage &img);
00185   virtual void shift (int yoffs, int xoffs);
00194   void fill (coeff *values, int fromY = 0, int fromX = 0,
00195              int toY = -1, int toX = -1);
00204   void fill (int *values, int fromY = 0, int fromX = 0,
00205              int toY = -1, int toX = -1);
00206 
00224   virtual ColorImage *fitInto (int rows, int cols,
00225                                int *fill = NULL, int function = 0) const;
00226 
00243   virtual ColorImage *fitInto (int rows, int cols, bool mirrorExtend,
00244                                int function = 0) const;
00245 
00262   virtual ColorImage *fitInto (int rows, int cols, ExtendFunc extend,
00263                                int function = 0) const;
00264 
00280   virtual ColorImage *fitInto (int rows, int cols, ResizeFillFunc *fillFunc,
00281                                int function = 0) const;
00282 
00292   virtual ColorImage *scale (double factor, int function = 0) const;
00293 
00305   virtual ColorImage *scale (double yFactor, double xFactor, int function = 0) const;
00306 
00307 private:
00309   int m_quality;
00310 protected:
00319   void init (Image **images = NULL, bool isReference = false, bool isMine = false);
00321   virtual void destroy (void);
00322 }; /* class ColorImage */
00323 
00326 #endif /* COLOR_IMAGE_HH__ */
00327 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines