Blender  V2.93
SteerableViewMap.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 
25 #include <map>
26 
27 #include "../geometry/Geom.h"
28 
29 #include "../system/FreestyleConfig.h"
30 
31 #ifdef WITH_CXX_GUARDEDALLOC
32 # include "MEM_guardedalloc.h"
33 #endif
34 
35 using namespace std;
36 
37 namespace Freestyle {
38 
39 using namespace Geometry;
40 
41 class FEdge;
42 class ImagePyramid;
43 class GrayImage;
44 
49  protected:
50  // for each vector the list of nbOrientations weights corresponding to its contributions
51  // to the nbOrientations directional maps
52  map<unsigned int, double *> _mapping;
53  unsigned _nbOrientations;
54  ImagePyramid **_imagesPyramids; // the pyramids of images storing the different SVM
55 
56  // internal
57  double _bound; // cos(Pi/N)
58  vector<Vec2d> _directions;
59 
60  public:
61  SteerableViewMap(unsigned int nbOrientations = 4);
62  SteerableViewMap(const SteerableViewMap &iBrother);
63  virtual ~SteerableViewMap();
64 
66  virtual void Reset();
67 
72  double *AddFEdge(FEdge *iFEdge);
73 
75  double ComputeWeight(const Vec2d &dir, unsigned iNOrientation);
76 
81  unsigned getSVMNumber(Vec2f dir);
82 
87  unsigned getSVMNumber(unsigned id);
88 
103  void buildImagesPyramids(GrayImage **steerableBases,
104  bool copy = false,
105  unsigned iNbLevels = 4,
106  float iSigma = 1.0f);
107 
127  float readSteerableViewMapPixel(unsigned iOrientation, int iLevel, int x, int y);
128 
134  float readCompleteViewMapPixel(int iLevel, int x, int y);
135 
137  unsigned int getNumberOfPyramidLevels() const;
138 
140  unsigned int getNumberOfOrientations() const
141  {
142  return _nbOrientations;
143  }
144 
146  void saveSteerableViewMap() const;
147 
148  protected:
149  void Clear();
150  void Build();
151 
152 #ifdef WITH_CXX_GUARDEDALLOC
153  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SteerableViewMap")
154 #endif
155 };
156 
157 } /* namespace Freestyle */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
unsigned int getNumberOfOrientations() const
map< unsigned int, double * > _mapping
inherits from class Rep
Definition: AppCanvas.cpp:32
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)