Blender V5.0
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
12
13#include <map>
14
15#include "../geometry/Geom.h"
16
18
19#include "MEM_guardedalloc.h"
20
21using namespace std;
22
23namespace Freestyle {
24
25using namespace Geometry;
26
27class FEdge;
28class ImagePyramid;
29class 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<uint, double *> _mapping;
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(uint 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, uint iNOrientation);
62
68
74
89 void buildImagesPyramids(GrayImage **steerableBases,
90 bool copy = false,
91 uint iNbLevels = 4,
92 float iSigma = 1.0f);
93
113 float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y);
114
120 float readCompleteViewMapPixel(int iLevel, int x, int y);
121
124
127 {
128 return _nbOrientations;
129 }
130
132 void saveSteerableViewMap() const;
133
134 protected:
135 void Clear();
136 void Build();
137
138 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SteerableViewMap")
139};
140
141} /* 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)
VecMat::Vec2< double > Vec2d
Definition Geom.h:23
VecMat::Vec2< float > Vec2f
Definition Geom.h:22
inherits from class Rep
Definition AppCanvas.cpp:20
static uint x[3]
Definition RandGen.cpp:77
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)