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

AdvancedFunctions1D.h

00001 //
00002 //  Filename         : AdvancedFunctions1D.h
00003 //  Author(s)        : Stephane Grabli, Emmanuel Turquin
00004 //  Purpose          : Functions taking 1D input
00005 //  Date of creation : 01/07/2003
00006 //
00008 
00009 
00010 //
00011 //  Copyright (C) : Please refer to the COPYRIGHT file distributed 
00012 //   with this source distribution. 
00013 //
00014 //  This program is free software; you can redistribute it and/or
00015 //  modify it under the terms of the GNU General Public License
00016 //  as published by the Free Software Foundation; either version 2
00017 //  of the License, or (at your option) any later version.
00018 //
00019 //  This program is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with this program; if not, write to the Free Software
00026 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 //
00029 
00030 #ifndef  ADVANCED_FUNCTIONS1D_HPP
00031 # define ADVANCED_FUNCTIONS1D_HPP
00032 
00033 
00034 # include "AdvancedFunctions0D.h"
00035 # include "../view_map/Functions1D.h"
00036 
00037 //
00038 // Functions definitions
00039 //
00041 
00042 namespace Functions1D {
00043 
00044   // DensityF1D
00052   class DensityF1D : public UnaryFunction1D<double>
00053   {
00054   private:
00055     float _sampling;
00056   public:
00070     DensityF1D(double sigma = 2, IntegrationType iType = MEAN, float sampling=2.f) : UnaryFunction1D<double>(iType), _fun(sigma) {
00071       _sampling = sampling;
00072     }
00074     virtual ~DensityF1D(){}
00075 
00077     string getName() const {
00078       return "DensityF1D";
00079     }
00081     double operator()(Interface1D& inter) {
00082       return integrate(_fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
00083     }
00084   private:
00085     Functions0D::DensityF0D     _fun;
00086   };
00087 
00088   // LocalAverageDepthF1D
00096   class LocalAverageDepthF1D : public UnaryFunction1D<double>
00097   {
00098     public:
00107     LocalAverageDepthF1D(real sigma, IntegrationType iType = MEAN) 
00108       : UnaryFunction1D<double>(iType), _fun(sigma){
00109     }
00111     string getName() const {
00112       return "LocalAverageDepthF1D";
00113     }
00115     double operator()(Interface1D& inter) {
00116       return integrate(_fun, inter.verticesBegin(), inter.verticesEnd(), _integration);
00117     }
00118   private:
00119     Functions0D::LocalAverageDepthF0D   _fun;
00120   };
00121 
00122   // GetCompleteViewMapDensity
00130   class LIB_STROKE_EXPORT GetCompleteViewMapDensityF1D : public UnaryFunction1D<double>
00131   {
00132   public:
00146     GetCompleteViewMapDensityF1D(unsigned level, IntegrationType iType = MEAN, float sampling=2.f) 
00147       : UnaryFunction1D<double>(iType), _fun(level){_sampling = sampling;}
00149     string getName() const {
00150       return "GetCompleteViewMapDensityF1D";
00151     }
00153     double operator()(Interface1D& inter);
00154     
00155   private:
00156     Functions0D::ReadCompleteViewMapPixelF0D _fun;
00157     float _sampling;
00158   };
00159 
00160   // GetDirectionalViewMapDensity
00170   class LIB_STROKE_EXPORT GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double>
00171   {
00172   public:
00189     GetDirectionalViewMapDensityF1D(unsigned iOrientation, unsigned level, IntegrationType iType = MEAN, float sampling=2.f) 
00190       : UnaryFunction1D<double>(iType), _fun(iOrientation,level){_sampling = sampling;}
00192     string getName() const {
00193       return "GetDirectionalViewMapDensityF1D";
00194     }
00196     double operator()(Interface1D& inter);
00197     
00198   private:
00199     Functions0D::ReadSteerableViewMapPixelF0D _fun;
00200     float _sampling;
00201   };
00202 
00203   // GetSteerableViewMapDensityF1D
00209   class LIB_STROKE_EXPORT GetSteerableViewMapDensityF1D : public UnaryFunction1D<real>
00210   {
00211   private:
00212     int _level;
00213     float _sampling;
00214   public:
00229     GetSteerableViewMapDensityF1D(int level,IntegrationType iType = MEAN, float sampling=2.f) : UnaryFunction1D<real>(iType) {
00230       _level = level;
00231       _sampling = sampling;
00232     }
00234     virtual ~GetSteerableViewMapDensityF1D(){}
00235 
00237     string getName() const {
00238       return "GetSteerableViewMapDensityF1D";
00239     }
00241     real operator()(Interface1D& inter);
00242   };
00243 
00244   // GetViewMapGradientNormF1D
00250   class LIB_STROKE_EXPORT GetViewMapGradientNormF1D : public UnaryFunction1D<real>
00251   {
00252   private:
00253     int _level;
00254     float _sampling;
00255     Functions0D::GetViewMapGradientNormF0D _func;
00256   public:
00271     GetViewMapGradientNormF1D(int level,IntegrationType iType = MEAN, float sampling=2.f) 
00272       : UnaryFunction1D<real>(iType), _func(level) {
00273       _level = level;
00274       _sampling = sampling;
00275     }
00276     
00278     string getName() const {
00279       return "GetViewMapGradientNormF1D";
00280     }
00282     real operator()(Interface1D& inter);
00283   };
00284 } // end of namespace Functions1D
00285 
00286 #endif // ADVANCED_FUNCTIONS1D_HPP