Wavelet and Image class library  1.3.2
StillImage.hh
Go to the documentation of this file.
00001 /*
00002  * class StillImage
00003  *
00004  * $Date$
00005  * $Revision$
00006  *
00007  */
00008 
00009 #ifndef STILL_IMAGE_HH__
00010 #define STILL_IMAGE_HH__
00011 
00012 #include "WImage/Image.hh"
00013 
00021 class 
00022 StillImage: public Image
00023 {
00024 public:
00025   
00031   StillImage (int rows = 0, int cols = 0);
00036   StillImage (ImageArray<coeff> &ia);
00038   virtual ~StillImage (void);
00039 
00047   virtual coeff at (int y, int x) const { return m_coeffs->at (y, x); }
00053   virtual coeff at (int abs) const { return m_coeffs->at (abs); }
00063   virtual void to (int y, int x, coeff val) { m_coeffs->to (y, x, val); }
00069   virtual void to (int abs, coeff val) { m_coeffs->to (abs, val); }
00070 
00078   virtual int abs (int y, int x) const { return m_coeffs->abs (y, x); }
00079   
00088   virtual bool epsilons (Image &si, coeff epsilon) const;
00094   virtual bool equals (Image &si) const;
00095 
00096 #ifndef _WIN32_WCE
00097 
00109   virtual void read (char const *fname, int rawy = 0, int rawx = 0);
00123   virtual void read (char const *fname, 
00124                      filetype ftype, int rawy = 0, int rawx = 0);
00125 
00132   virtual void write (char const *fname, bool beautify = false);
00141   virtual void write (char const *fname, filetype ftype, 
00142                       bool beautify = false);
00143 #endif
00144 
00149   virtual Image *clone (void) const;
00150 
00156   inline static Image *makeEmpty (int rows = 0, int cols = 0) 
00157   { return new StillImage (rows, cols); }
00158 
00166   virtual coeff smax (int fromY = 0, int fromX = 0,
00167                       int toY = -1, int toX = -1) const { 
00168     return m_coeffs->smax (fromY, fromX, toY, toX); 
00169   }
00177   virtual coeff smin (int fromY = 0, int fromX = 0,
00178                       int toY = -1, int toX = -1) const { 
00179     return m_coeffs->smin (fromY, fromX, toY, toX); 
00180   }
00188   virtual coeff amax (int fromY = 0, int fromX = 0,
00189                       int toY = -1, int toX = -1) const { 
00190     return m_coeffs->amax (fromY, fromX, toY, toX); 
00191   }
00199   virtual coeff amin (int fromY = 0, int fromX = 0,
00200                       int toY = -1, int toX = -1) const { 
00201     return m_coeffs->amin (fromY, fromX, toY, toX); 
00202   }
00211   virtual coeff saverage (int fromY = 0, int fromX = 0, 
00212                           int toY = -1, int toX = -1) const { 
00213     return m_coeffs->saverage (fromY, fromX, toY, toX); }
00214 
00223   virtual coeff aaverage (int fromY = 0, int fromX = 0, 
00224                           int toY = -1, int toX = -1) const { 
00225     return m_coeffs->aaverage (fromY, fromX, toY, toX); }
00226 
00236   virtual void resize (int rows, int cols);
00237 
00238 #ifdef USE_DEPRECATED_API
00239 
00247   inline bool epsilons (StillImage *si, coeff epsilon) const 
00248   { return Image::epsilons (si, epsilon); }
00250   inline bool equals (StillImage *si) const { return Image::equals (si); }
00251 #endif
00252 
00253 protected:
00256   StillImage (bool dummy) {}
00259   ImageArray<coeff> *m_coeffs;
00260 
00263   bool m_coeffsMustDelete;
00264 
00272   virtual Image *mkImage (int rows = 0, int cols = 0) const;
00273 }; /* class StillImage */
00274 
00277 #endif /* STILL_IMAGE_HH__ */
00278 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines