Blender  V3.3
AdvancedFunctions0D.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "../image/GaussianFilter.h"
11 #include "../image/Image.h"
12 
13 #include "../view_map/Functions0D.h"
14 
15 //
16 // Functions definitions
17 //
19 
20 namespace Freestyle {
21 
22 namespace Functions0D {
23 
24 // DensityF0D
29 class DensityF0D : public UnaryFunction0D<double> {
30  public:
36  DensityF0D(double sigma = 2) : UnaryFunction0D<double>()
37  {
38  _filter.setSigma((float)sigma);
39  }
40 
42  string getName() const
43  {
44  return "DensityF0D";
45  }
46 
49 
50  private:
51  GaussianFilter _filter;
52 };
53 
54 // LocalAverageDepthF0D
58 class LocalAverageDepthF0D : public UnaryFunction0D<double> {
59  private:
60  GaussianFilter _filter;
61 
62  public:
65  {
66  _filter.setSigma((float)maskSize / 2.0f);
67  }
68 
70  string getName() const
71  {
72  return "LocalAverageDepthF0D";
73  }
74 
77 };
78 
79 // ReadMapPixel
81 class ReadMapPixelF0D : public UnaryFunction0D<float> {
82  private:
83  const char *_mapName;
84  int _level;
85 
86  public:
94  ReadMapPixelF0D(const char *iMapName, int level) : UnaryFunction0D<float>()
95  {
96  _mapName = iMapName;
97  _level = level;
98  }
99 
101  string getName() const
102  {
103  return "ReadMapPixelF0D";
104  }
105 
107  int operator()(Interface0DIterator &iter);
108 };
109 
110 // ReadSteerableViewMapPixel
113  private:
114  unsigned _orientation;
115  int _level;
116 
117  public:
124  ReadSteerableViewMapPixelF0D(unsigned nOrientation, int level) : UnaryFunction0D<float>()
125  {
126  _orientation = nOrientation;
127  _level = level;
128  }
129 
131  string getName() const
132  {
133  return "ReadSteerableViewMapPixelF0D";
134  }
135 
137  int operator()(Interface0DIterator &iter);
138 };
139 
140 // ReadCompleteViewMapPixel
143  private:
144  int _level;
145 
146  public:
152  {
153  _level = level;
154  }
155 
157  string getName() const
158  {
159  return "ReadCompleteViewMapPixelF0D";
160  }
161 
163  int operator()(Interface0DIterator &iter);
164 };
165 
166 // GetViewMapGradientNormF0D
169  private:
170  int _level;
171  float _step;
172 
173  public:
179  {
180  _level = level;
181  _step = (float)pow(2.0, _level);
182  }
183 
185  string getName() const
186  {
187  return "GetViewMapGradientNormF0D";
188  }
189 
191  int operator()(Interface0DIterator &iter);
192 };
193 
194 } // end of namespace Functions0D
195 
196 } /* 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)
ccl_device_inline float3 pow(float3 v, float e)
Definition: math_float3.h:533
inherits from class Rep
Definition: AppCanvas.cpp:18
double real
Definition: Precision.h:12