Wavelet and Image class library  1.3.2
WaveletTransform.hh
Go to the documentation of this file.
00001 /*
00002  * class WaveletTransform
00003  *
00004  * $Date$
00005  * $Revision$
00006  *
00007  */
00008 
00014 #ifndef WAVELET_TRANSFORM_HH__
00015 #define WAVELET_TRANSFORM_HH__
00016 
00017 #include "Wave/Wavelet.hh"
00018 #include "WImage/CoeffInformation.hh"
00019 #include "Wave/Filter.hh"
00020 
00025 /*abstract*/
00026 class
00027 WaveletTransform
00028 {
00029 public:
00035   WaveletTransform (Image &img, FilterSet &fil);
00037   virtual ~WaveletTransform (void);
00038 
00044   virtual void analysis (int steps);
00054   virtual void synthesis (int steps, int prevSteps = 0);
00057   void expandImage (void);
00059   void restoreImage (void);
00060 
00079   virtual void where (area what, int subband, int &yoffs,
00080                       int &xoffs, int &ysize, int &xsize) const;
00081 
00096   virtual void where (int ypos, int xpos, int &subband, area &channel,
00097                       int steps = -1) const;
00098 
00123   virtual void mapPosition (int yOld, int xOld, int toSubband,
00124                             area toChannel, int &yNew, int &xNew,
00125                             int &sizeFactor, int steps = -1) const;
00126 
00133   virtual coeff saverage (int subband, area channel) const;
00134 
00141   virtual coeff aaverage (int subband, area channel) const;
00142 
00149   virtual coeff sqvariance (int subband, area channel) const;
00150 
00158   virtual coeff variance (int subband, area channel, bool abs = false) const;
00159 
00167   virtual coeff sdeviation (int subband, area channel, bool abs = false) const;
00168 
00178   virtual coeff ratio (int subband1, int subband2);
00179 
00184   inline Image *ll (int steps = -1) { return subband (LL, steps); }
00189   inline Image *hl (int steps = -1) { return subband (HL, steps); }
00194   inline Image *lh (int steps = -1) { return subband (LH, steps); }
00199   inline Image *hh (int steps = -1) { return subband (HH, steps); }
00207   Image *highMax(int steps = -1);
00210   inline Image &image (void) const { return *m_image; }
00211 
00218   virtual Image *subband (area what, int steps = -1);
00219 
00233   virtual int getSubband (int ypos, int xpos, int steps = -1);
00246   inline int getSubband (CoeffInformation &c, int steps = -1) {
00247     return getSubband (c.ypos (), c.xpos (), steps);
00248   }
00249 
00263   virtual area getArea (int ypos, int xpos, int steps = -1);
00276   inline area getArea (CoeffInformation &c, int steps = -1) {
00277     return getArea (c.ypos (), c.xpos (), steps);
00278   }
00279 
00290   virtual void import (Image &img, area what, int steps = -1);
00291 
00302   virtual void fill (coeff value, area what, int steps = -1);
00303 
00306   inline int steps (void) const {
00307     return m_image->anasteps () - m_image->synsteps (); }
00308 
00309 #ifdef USE_DEPRECATED_API
00310   inline void import (Image &img, area what, int steps = -1) {
00311     import &img, what, steps); }
00312 #endif
00313 private:
00315   void sanity (void);
00316 protected:
00318   Wavelet *m_wavelet;
00320   Image *m_image;
00322   Image *m_buffer;
00324   FilterSet *m_filter;
00326   int m_rows;
00328   int m_cols;
00329 
00333   virtual void doanalysis (int steps) = 0;
00341   virtual void dosynthesis (int steps, int prevSteps = 0) = 0;
00342 
00343 }; /* class WaveletTransform */
00344 
00347 #endif /* WAVELET_TRANSFORM_HH__ */
00348 
00349 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines