h o m e d o c u m e n t a t i o n c l a s s h i e r a r c h y

AdvancedFunctions0D.h

00001 //
00002 //  Filename         : AdvancedFunctions0D.h
00003 //  Author(s)        : Stephane Grabli
00004 //                     Emmanuel Turquin
00005 //  Purpose          : Functions taking 0D input
00006 //  Date of creation : 01/07/2003
00007 //
00009 
00010 
00011 //
00012 //  Copyright (C) : Please refer to the COPYRIGHT file distributed 
00013 //   with this source distribution. 
00014 //
00015 //  This program is free software; you can redistribute it and/or
00016 //  modify it under the terms of the GNU General Public License
00017 //  as published by the Free Software Foundation; either version 2
00018 //  of the License, or (at your option) any later version.
00019 //
00020 //  This program is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU General Public License
00026 //  along with this program; if not, write to the Free Software
00027 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00028 //
00030 
00031 #ifndef  ADVANCED_FUNCTIONS0D_HPP
00032 # define ADVANCED_FUNCTIONS0D_HPP
00033 
00034 
00035 # include "../image/Image.h"
00036 # include "../image/GaussianFilter.h"
00037 # include "../view_map/Functions0D.h"
00038 
00039 //
00040 // Functions definitions
00041 //
00043 
00044 namespace Functions0D {
00045 
00046   // DensityF0D
00052   class LIB_STROKE_EXPORT DensityF0D : public UnaryFunction0D<double>
00053   {
00054   public:
00061     DensityF0D(double sigma = 2) : UnaryFunction0D<double>() {
00062       _filter.SetSigma((float)sigma);
00063     }
00065     string getName() const {
00066       return "DensityF0D";
00067     }
00069     double operator()(Interface0DIterator& iter);
00070 
00071   private:
00072 
00073     GaussianFilter _filter;
00074   };
00075 
00076   // LocalAverageDepthF0D
00081   class LIB_STROKE_EXPORT LocalAverageDepthF0D : public UnaryFunction0D<double>
00082   {
00083   private:
00084     GaussianFilter _filter;
00085   public:
00089     LocalAverageDepthF0D(real maskSize=5.f) : UnaryFunction0D<double>() {
00090       _filter.SetSigma((float)maskSize/2.f);
00091     }
00093     string getName() const {
00094       return "LocalAverageDepthF0D";
00095     }
00097     double operator()(Interface0DIterator& iter);
00098   };
00099 
00100   // ReadMapPixel
00103   class LIB_STROKE_EXPORT ReadMapPixelF0D : public UnaryFunction0D<float>
00104   {
00105   private:
00106     const char * _mapName;
00107     int _level;
00108   public:
00117     ReadMapPixelF0D(const char *iMapName, int level) : UnaryFunction0D<float>() {
00118       _mapName = iMapName;
00119       _level = level;
00120     }
00122     string getName() const {
00123       return "ReadMapPixelF0D";
00124     }
00126     float operator()(Interface0DIterator& iter);
00127   };
00128   
00129   // ReadSteerableViewMapPixel
00132   class LIB_STROKE_EXPORT ReadSteerableViewMapPixelF0D : public UnaryFunction0D<float>
00133   {
00134   private:
00135     unsigned _orientation;
00136     int _level;
00137   public:
00146     ReadSteerableViewMapPixelF0D(unsigned nOrientation, int level) : UnaryFunction0D<float>() {
00147       _orientation = nOrientation;
00148       _level = level;
00149     }
00151     string getName() const {
00152       return "ReadSteerableViewMapPixelF0D";
00153     }
00155     float operator()(Interface0DIterator& iter);
00156   };
00157 
00158   // ReadCompleteViewMapPixel
00161   class LIB_STROKE_EXPORT ReadCompleteViewMapPixelF0D : public UnaryFunction0D<float>
00162   {
00163   private:
00164     int _level;
00165   public:
00171     ReadCompleteViewMapPixelF0D(int level) : UnaryFunction0D<float>() {
00172       _level = level;
00173     }
00175     string getName() const {
00176       return "ReadCompleteViewMapPixelF0D";
00177     }
00179     float operator()(Interface0DIterator& iter);
00180   };
00181   
00182   // GetViewMapGradientNormF0D
00185   class LIB_STROKE_EXPORT GetViewMapGradientNormF0D: public UnaryFunction0D< float>
00186   {
00187     private:
00188     int _level;
00189     float _step;
00190   public:
00196     GetViewMapGradientNormF0D(int level) : UnaryFunction0D<float>() {
00197       _level = level;
00198       _step = (float)pow(2.0,_level);
00199     }
00201     string getName() const {
00202       return "GetViewMapGradientNormF0D";
00203     }
00205     float operator()(Interface0DIterator& iter);
00206   };
00207 } // end of namespace Functions0D
00208 
00209 #endif // ADVANCED_FUNCTIONS0D_HPP