2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* ***** END GPL LICENSE BLOCK *****
21
/** \file source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp
25
#include "BPy_GetDirectionalViewMapDensityF1D.h"
27
#include "../../../stroke/AdvancedFunctions1D.h"
28
#include "../../BPy_Convert.h"
29
#include "../../BPy_IntegrationType.h"
35
///////////////////////////////////////////////////////////////////////////////////////////
37
//------------------------INSTANCE METHODS ----------------------------------
39
static char GetDirectionalViewMapDensityF1D___doc__[] =
40
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` "
41
"> :class:`GetDirectionalViewMapDensityF1D`\n"
43
".. method:: __init__(orientation, level, integration_type=IntegrationType.MEAN, sampling=2.0)\n"
45
" Builds a GetDirectionalViewMapDensityF1D object.\n"
47
" :arg orientation: The number of the directional map we must work\n"
49
" :type orientation: int\n"
50
" :arg level: The level of the pyramid from which the pixel must be\n"
53
" :arg integration_type: The integration method used to compute a single value\n"
54
" from a set of values.\n"
55
" :type integration_type: :class:`IntegrationType`\n"
56
" :arg sampling: The resolution used to sample the chain: the\n"
57
" corresponding 0D function is evaluated at each sample point and\n"
58
" the result is obtained by combining the resulting values into a\n"
59
" single one, following the method specified by integration_type.\n"
60
" :type sampling: float\n"
62
".. method:: __call__(inter)\n"
64
" Returns the density evaluated for an Interface1D in of the\n"
65
" steerable viewmaps image. The direction telling which Directional\n"
66
" map to choose is explicitely specified by the user. The density is\n"
67
" evaluated for a set of points along the Interface1D (using the\n"
68
" :class:`ReadSteerableViewMapPixelF0D` functor) and then integrated\n"
69
" into a single value using a user-defined integration method.\n"
71
" :arg inter: An Interface1D object.\n"
72
" :type inter: :class:`Interface1D`\n"
73
" :return: the density evaluated for an Interface1D in of the\n"
74
" steerable viewmaps image.\n"
77
static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDensityF1D *self,
78
PyObject *args, PyObject *kwds)
80
static const char *kwlist[] = {"orientation", "level", "integration_type", "sampling", NULL};
85
if (!PyArg_ParseTupleAndKeywords(args, kwds, "II|O!f", (char **)kwlist, &u1, &u2, &IntegrationType_Type, &obj, &f))
87
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
88
self->py_uf1D_double.uf1D_double = new Functions1D::GetDirectionalViewMapDensityF1D(u1, u2, t, f);
92
/*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition ------------------------------*/
94
PyTypeObject GetDirectionalViewMapDensityF1D_Type = {
95
PyVarObject_HEAD_INIT(NULL, 0)
96
"GetDirectionalViewMapDensityF1D", /* tp_name */
97
sizeof(BPy_GetDirectionalViewMapDensityF1D), /* tp_basicsize */
105
0, /* tp_as_number */
106
0, /* tp_as_sequence */
107
0, /* tp_as_mapping */
113
0, /* tp_as_buffer */
114
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
115
GetDirectionalViewMapDensityF1D___doc__, /* tp_doc */
118
0, /* tp_richcompare */
119
0, /* tp_weaklistoffset */
125
&UnaryFunction1DDouble_Type, /* tp_base */
127
0, /* tp_descr_get */
128
0, /* tp_descr_set */
129
0, /* tp_dictoffset */
130
(initproc)GetDirectionalViewMapDensityF1D___init__, /* tp_init */
135
///////////////////////////////////////////////////////////////////////////////////////////