Blender
V4.3
source
blender
freestyle
intern
view_map
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
17
#include "
../system/FreestyleConfig.h
"
18
19
#ifdef WITH_CXX_GUARDEDALLOC
20
# include "
MEM_guardedalloc.h
"
21
#endif
22
23
using namespace
std;
24
25
namespace
Freestyle
{
26
27
using namespace
Geometry
;
28
29
class
FEdge;
30
class
ImagePyramid;
31
class
GrayImage;
32
36
class
SteerableViewMap
{
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
;
41
uint
_nbOrientations
;
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
69
uint
getSVMNumber
(
Vec2f
dir);
70
75
uint
getSVMNumber
(
uint
id
);
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
125
uint
getNumberOfPyramidLevels
()
const
;
126
128
uint
getNumberOfOrientations
()
const
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 */
uint
unsigned int uint
Definition
BLI_sys_types.h:68
FreestyleConfig.h
Configuration definitions.
Geom.h
Vectors and Matrices (useful type definitions)
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
Freestyle::FEdge
Definition
Silhouette.h:465
Freestyle::GrayImage
Definition
Image.h:303
Freestyle::ImagePyramid
Definition
ImagePyramid.h:24
Freestyle::SteerableViewMap
Definition
SteerableViewMap.h:36
Freestyle::SteerableViewMap::AddFEdge
double * AddFEdge(FEdge *iFEdge)
Definition
SteerableViewMap.cpp:111
Freestyle::SteerableViewMap::getSVMNumber
uint getSVMNumber(Vec2f dir)
Definition
SteerableViewMap.cpp:138
Freestyle::SteerableViewMap::Clear
void Clear()
Definition
SteerableViewMap.cpp:71
Freestyle::SteerableViewMap::_nbOrientations
uint _nbOrientations
Definition
SteerableViewMap.h:41
Freestyle::SteerableViewMap::readCompleteViewMapPixel
float readCompleteViewMapPixel(int iLevel, int x, int y)
Definition
SteerableViewMap.cpp:216
Freestyle::SteerableViewMap::_bound
double _bound
Definition
SteerableViewMap.h:45
Freestyle::SteerableViewMap::getNumberOfPyramidLevels
uint getNumberOfPyramidLevels() const
Definition
SteerableViewMap.cpp:221
Freestyle::SteerableViewMap::getNumberOfOrientations
uint getNumberOfOrientations() const
Definition
SteerableViewMap.h:128
Freestyle::SteerableViewMap::SteerableViewMap
SteerableViewMap(uint nbOrientations=4)
Definition
SteerableViewMap.cpp:33
Freestyle::SteerableViewMap::_mapping
map< uint, double * > _mapping
Definition
SteerableViewMap.h:40
Freestyle::SteerableViewMap::_directions
vector< Vec2d > _directions
Definition
SteerableViewMap.h:46
Freestyle::SteerableViewMap::~SteerableViewMap
virtual ~SteerableViewMap()
Definition
SteerableViewMap.cpp:66
Freestyle::SteerableViewMap::ComputeWeight
double ComputeWeight(const Vec2d &dir, uint iNOrientation)
Definition
SteerableViewMap.cpp:98
Freestyle::SteerableViewMap::Reset
virtual void Reset()
Definition
SteerableViewMap.cpp:92
Freestyle::SteerableViewMap::saveSteerableViewMap
void saveSteerableViewMap() const
Definition
SteerableViewMap.cpp:229
Freestyle::SteerableViewMap::readSteerableViewMapPixel
float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y)
Definition
SteerableViewMap.cpp:195
Freestyle::SteerableViewMap::Build
void Build()
Definition
SteerableViewMap.cpp:44
Freestyle::SteerableViewMap::_imagesPyramids
ImagePyramid ** _imagesPyramids
Definition
SteerableViewMap.h:42
Freestyle::SteerableViewMap::buildImagesPyramids
void buildImagesPyramids(GrayImage **steerableBases, bool copy=false, uint iNbLevels=4, float iSigma=1.0f)
Definition
SteerableViewMap.cpp:177
Freestyle::VecMat::Vec2< double >
Geometry
Definition
scene/geometry.h:70
Freestyle
inherits from class Rep
Definition
AppCanvas.cpp:20
copy
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
Definition
node_texture_output.cc:130
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0