00001
00002
00003
00004
00005
00006
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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
00039
00041
00042 namespace Functions1D {
00043
00044
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
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
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
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
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
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 }
00285
00286 #endif // ADVANCED_FUNCTIONS1D_HPP