Blender  V3.3
BPy_DensityF0D.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BPy_DensityF0D.h"
8 
9 #include "../../../stroke/AdvancedFunctions0D.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
21 static char DensityF0D___doc__[] =
22  "Class hierarchy: :class:`freestyle.types.UnaryFunction0D` > "
23  ":class:`freestyle.types.UnaryFunction0DDouble` > :class:`DensityF0D`\n"
24  "\n"
25  ".. method:: __init__(sigma=2.0)\n"
26  "\n"
27  " Builds a DensityF0D object.\n"
28  "\n"
29  " :arg sigma: The gaussian sigma value indicating the X value for\n"
30  " which the gaussian function is 0.5. It leads to the window size\n"
31  " value (the larger, the smoother).\n"
32  " :type sigma: float\n"
33  "\n"
34  ".. method:: __call__(it)\n"
35  "\n"
36  " Returns the density of the (result) image evaluated at the\n"
37  " :class:`freestyle.types.Interface0D` pointed by the\n"
38  " Interface0DIterator. This density is evaluated using a pixels square\n"
39  " window around the evaluation point and integrating these values using\n"
40  " a gaussian.\n"
41  "\n"
42  " :arg it: An Interface0DIterator object.\n"
43  " :type it: :class:`freestyle.types.Interface0DIterator`\n"
44  " :return: The density of the image evaluated at the pointed\n"
45  " Interface0D.\n"
46  " :rtype: float\n";
47 
48 static int DensityF0D___init__(BPy_DensityF0D *self, PyObject *args, PyObject *kwds)
49 {
50  static const char *kwlist[] = {"sigma", nullptr};
51  double d = 2;
52 
53  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|d", (char **)kwlist, &d)) {
54  return -1;
55  }
56  self->py_uf0D_double.uf0D_double = new Functions0D::DensityF0D(d);
57  self->py_uf0D_double.uf0D_double->py_uf0D = (PyObject *)self;
58  return 0;
59 }
60 
61 /*-----------------------BPy_DensityF0D type definition ------------------------------*/
62 
63 PyTypeObject DensityF0D_Type = {
64  PyVarObject_HEAD_INIT(nullptr, 0) "DensityF0D", /* tp_name */
65  sizeof(BPy_DensityF0D), /* tp_basicsize */
66  0, /* tp_itemsize */
67  nullptr, /* tp_dealloc */
68  0, /* tp_vectorcall_offset */
69  nullptr, /* tp_getattr */
70  nullptr, /* tp_setattr */
71  nullptr, /* tp_reserved */
72  nullptr, /* tp_repr */
73  nullptr, /* tp_as_number */
74  nullptr, /* tp_as_sequence */
75  nullptr, /* tp_as_mapping */
76  nullptr, /* tp_hash */
77  nullptr, /* tp_call */
78  nullptr, /* tp_str */
79  nullptr, /* tp_getattro */
80  nullptr, /* tp_setattro */
81  nullptr, /* tp_as_buffer */
82  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
83  DensityF0D___doc__, /* tp_doc */
84  nullptr, /* tp_traverse */
85  nullptr, /* tp_clear */
86  nullptr, /* tp_richcompare */
87  0, /* tp_weaklistoffset */
88  nullptr, /* tp_iter */
89  nullptr, /* tp_iternext */
90  nullptr, /* tp_methods */
91  nullptr, /* tp_members */
92  nullptr, /* tp_getset */
93  &UnaryFunction0DDouble_Type, /* tp_base */
94  nullptr, /* tp_dict */
95  nullptr, /* tp_descr_get */
96  nullptr, /* tp_descr_set */
97  0, /* tp_dictoffset */
98  (initproc)DensityF0D___init__, /* tp_init */
99  nullptr, /* tp_alloc */
100  nullptr, /* tp_new */
101 };
102 
104 
105 #ifdef __cplusplus
106 }
107 #endif
static char DensityF0D___doc__[]
static int DensityF0D___init__(BPy_DensityF0D *self, PyObject *args, PyObject *kwds)
PyTypeObject DensityF0D_Type
PyTypeObject UnaryFunction0DDouble_Type
inherits from class Rep
Definition: AppCanvas.cpp:18