Blender  V3.3
SteerableViewMap.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
11 #include <map>
12 
13 #include "../geometry/Geom.h"
14 
15 #include "../system/FreestyleConfig.h"
16 
17 #ifdef WITH_CXX_GUARDEDALLOC
18 # include "MEM_guardedalloc.h"
19 #endif
20 
21 using namespace std;
22 
23 namespace Freestyle {
24 
25 using namespace Geometry;
26 
27 class FEdge;
28 class ImagePyramid;
29 class GrayImage;
30 
35  protected:
36  // for each vector the list of nbOrientations weights corresponding to its contributions
37  // to the nbOrientations directional maps
38  map<unsigned int, double *> _mapping;
39  unsigned _nbOrientations;
40  ImagePyramid **_imagesPyramids; // the pyramids of images storing the different SVM
41 
42  // internal
43  double _bound; // cos(Pi/N)
44  vector<Vec2d> _directions;
45 
46  public:
47  SteerableViewMap(unsigned int nbOrientations = 4);
48  SteerableViewMap(const SteerableViewMap &iBrother);
49  virtual ~SteerableViewMap();
50 
52  virtual void Reset();
53 
58  double *AddFEdge(FEdge *iFEdge);
59 
61  double ComputeWeight(const Vec2d &dir, unsigned iNOrientation);
62 
67  unsigned getSVMNumber(Vec2f dir);
68 
73  unsigned getSVMNumber(unsigned id);
74 
89  void buildImagesPyramids(GrayImage **steerableBases,
90  bool copy = false,
91  unsigned iNbLevels = 4,
92  float iSigma = 1.0f);
93 
113  float readSteerableViewMapPixel(unsigned iOrientation, int iLevel, int x, int y);
114 
120  float readCompleteViewMapPixel(int iLevel, int x, int y);
121 
123  unsigned int getNumberOfPyramidLevels() const;
124 
126  unsigned int getNumberOfOrientations() const
127  {
128  return _nbOrientations;
129  }
130 
132  void saveSteerableViewMap() const;
133 
134  protected:
135  void Clear();
136  void Build();
137 
138 #ifdef WITH_CXX_GUARDEDALLOC
139  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SteerableViewMap")
140 #endif
141 };
142 
143 } /* 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:18
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)