Blender V4.3
SteerableViewMap.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
13#include <map>
14
15#include "../geometry/Geom.h"
16
18
19#ifdef WITH_CXX_GUARDEDALLOC
20# include "MEM_guardedalloc.h"
21#endif
22
23using namespace std;
24
25namespace Freestyle {
26
27using namespace Geometry;
28
29class FEdge;
30class ImagePyramid;
31class GrayImage;
32
37 protected:
38 // for each vector the list of nbOrientations weights corresponding to its contributions
39 // to the nbOrientations directional maps
40 map<uint, double *> _mapping;
42 ImagePyramid **_imagesPyramids; // the pyramids of images storing the different SVM
43
44 // internal
45 double _bound; // cos(Pi/N)
46 vector<Vec2d> _directions;
47
48 public:
49 SteerableViewMap(uint nbOrientations = 4);
50 SteerableViewMap(const SteerableViewMap &iBrother);
51 virtual ~SteerableViewMap();
52
54 virtual void Reset();
55
60 double *AddFEdge(FEdge *iFEdge);
61
63 double ComputeWeight(const Vec2d &dir, uint iNOrientation);
64
70
76
91 void buildImagesPyramids(GrayImage **steerableBases,
92 bool copy = false,
93 uint iNbLevels = 4,
94 float iSigma = 1.0f);
95
115 float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y);
116
122 float readCompleteViewMapPixel(int iLevel, int x, int y);
123
126
129 {
130 return _nbOrientations;
131 }
132
134 void saveSteerableViewMap() const;
135
136 protected:
137 void Clear();
138 void Build();
139
140#ifdef WITH_CXX_GUARDEDALLOC
141 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SteerableViewMap")
142#endif
143};
144
145} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
Vectors and Matrices (useful type definitions)
Read Guarded memory(de)allocation.
double * AddFEdge(FEdge *iFEdge)
float readCompleteViewMapPixel(int iLevel, int x, int y)
SteerableViewMap(uint nbOrientations=4)
map< uint, double * > _mapping
double ComputeWeight(const Vec2d &dir, uint iNOrientation)
float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y)
void buildImagesPyramids(GrayImage **steerableBases, bool copy=false, uint iNbLevels=4, float iSigma=1.0f)
inherits from class Rep
Definition AppCanvas.cpp:20
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)