Blender  V2.93
AdvancedFunctions0D.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "../image/GaussianFilter.h"
25 #include "../image/Image.h"
26 
27 #include "../view_map/Functions0D.h"
28 
29 //
30 // Functions definitions
31 //
33 
34 namespace Freestyle {
35 
36 namespace Functions0D {
37 
38 // DensityF0D
43 class DensityF0D : public UnaryFunction0D<double> {
44  public:
50  DensityF0D(double sigma = 2) : UnaryFunction0D<double>()
51  {
52  _filter.setSigma((float)sigma);
53  }
54 
56  string getName() const
57  {
58  return "DensityF0D";
59  }
60 
63 
64  private:
65  GaussianFilter _filter;
66 };
67 
68 // LocalAverageDepthF0D
72 class LocalAverageDepthF0D : public UnaryFunction0D<double> {
73  private:
74  GaussianFilter _filter;
75 
76  public:
79  {
80  _filter.setSigma((float)maskSize / 2.0f);
81  }
82 
84  string getName() const
85  {
86  return "LocalAverageDepthF0D";
87  }
88 
91 };
92 
93 // ReadMapPixel
95 class ReadMapPixelF0D : public UnaryFunction0D<float> {
96  private:
97  const char *_mapName;
98  int _level;
99 
100  public:
108  ReadMapPixelF0D(const char *iMapName, int level) : UnaryFunction0D<float>()
109  {
110  _mapName = iMapName;
111  _level = level;
112  }
113 
115  string getName() const
116  {
117  return "ReadMapPixelF0D";
118  }
119 
121  int operator()(Interface0DIterator &iter);
122 };
123 
124 // ReadSteerableViewMapPixel
127  private:
128  unsigned _orientation;
129  int _level;
130 
131  public:
138  ReadSteerableViewMapPixelF0D(unsigned nOrientation, int level) : UnaryFunction0D<float>()
139  {
140  _orientation = nOrientation;
141  _level = level;
142  }
143 
145  string getName() const
146  {
147  return "ReadSteerableViewMapPixelF0D";
148  }
149 
151  int operator()(Interface0DIterator &iter);
152 };
153 
154 // ReadCompleteViewMapPixel
157  private:
158  int _level;
159 
160  public:
166  {
167  _level = level;
168  }
169 
171  string getName() const
172  {
173  return "ReadCompleteViewMapPixelF0D";
174  }
175 
177  int operator()(Interface0DIterator &iter);
178 };
179 
180 // GetViewMapGradientNormF0D
183  private:
184  int _level;
185  float _step;
186 
187  public:
193  {
194  _level = level;
195  _step = (float)pow(2.0, _level);
196  }
197 
199  string getName() const
200  {
201  return "GetViewMapGradientNormF0D";
202  }
203 
205  int operator()(Interface0DIterator &iter);
206 };
207 
208 } // end of namespace Functions0D
209 
210 } /* namespace Freestyle */
typedef float(TangentPoint)[2]
typedef double(DMatrix)[4][4]
int operator()(Interface0DIterator &iter)
ReadMapPixelF0D(const char *iMapName, int level)
int operator()(Interface0DIterator &iter)
ReadSteerableViewMapPixelF0D(unsigned nOrientation, int level)
void setSigma(float sigma)
inherits from class Rep
Definition: AppCanvas.cpp:32
double real
Definition: Precision.h:26
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
Definition: rall1d.h:359