28 ContextFunctions_get_time_stamp___doc__,
29 ".. function:: get_time_stamp()\n"
31 " Returns the system time stamp.\n"
33 " :return: The system time stamp.\n"
43 ContextFunctions_get_canvas_width___doc__,
44 ".. method:: get_canvas_width()\n"
46 " Returns the canvas width.\n"
48 " :return: The canvas width.\n"
58 ContextFunctions_get_canvas_height___doc__,
59 ".. method:: get_canvas_height()\n"
61 " Returns the canvas height.\n"
63 " :return: The canvas height.\n"
73 ContextFunctions_get_border___doc__,
74 ".. method:: get_border()\n"
76 " Returns the border.\n"
78 " :return: A tuple of 4 numbers (xmin, ymin, xmax, ymax).\n"
79 " :rtype: tuple[int, int, int, int]\n");
84 PyObject *
v = PyTuple_New(4);
86 PyLong_FromLong(border.
getMin().x()),
87 PyLong_FromLong(border.
getMin().y()),
88 PyLong_FromLong(border.
getMax().x()),
89 PyLong_FromLong(border.
getMax().y()));
95 ContextFunctions_load_map___doc__,
96 ".. function:: load_map(file_name, map_name, num_levels=4, sigma=1.0)\n"
98 " Loads an image map for further reading.\n"
100 " :arg file_name: The name of the image file.\n"
101 " :type file_name: str\n"
102 " :arg map_name: The name that will be used to access this image.\n"
103 " :type map_name: str\n"
104 " :arg num_levels: The number of levels in the map pyramid\n"
105 " (default = 4). If num_levels == 0, the complete pyramid is\n"
107 " :type num_levels: int\n"
108 " :arg sigma: The sigma value of the gaussian function.\n"
109 " :type sigma: float\n");
113 static const char *kwlist[] = {
"file_name",
"map_name",
"num_levels",
"sigma",
nullptr};
114 char *fileName, *mapName;
118 if (!PyArg_ParseTupleAndKeywords(
119 args, kwds,
"ss|If", (
char **)kwlist, &fileName, &mapName, &nbLevels, &sigma))
129 ContextFunctions_read_map_pixel___doc__,
130 ".. function:: read_map_pixel(map_name, level, x, y)\n"
132 " Reads a pixel in a user-defined map.\n"
134 " :arg map_name: The name of the map.\n"
135 " :type map_name: str\n"
136 " :arg level: The level of the pyramid in which we wish to read the\n"
138 " :type level: int\n"
139 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
140 " is in the lower-left corner.\n"
142 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
143 " is in the lower-left corner.\n"
145 " :return: The floating-point value stored for that pixel.\n"
152 static const char *kwlist[] = {
"map_name",
"level",
"x",
"y",
nullptr};
157 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"siII", (
char **)kwlist, &mapName, &level, &x, &y))
166 ContextFunctions_read_complete_view_map_pixel___doc__,
167 ".. function:: read_complete_view_map_pixel(level, x, y)\n"
169 " Reads a pixel in the complete view map.\n"
171 " :arg level: The level of the pyramid in which we wish to read the\n"
173 " :type level: int\n"
174 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
175 " is in the lower-left corner.\n"
177 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
178 " is in the lower-left corner.\n"
180 " :return: The floating-point value stored for that pixel.\n"
187 static const char *kwlist[] = {
"level",
"x",
"y",
nullptr};
191 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"iII", (
char **)kwlist, &level, &x, &y)) {
199 ContextFunctions_read_directional_view_map_pixel___doc__,
200 ".. function:: read_directional_view_map_pixel(orientation, level, x, y)\n"
202 " Reads a pixel in one of the oriented view map images.\n"
204 " :arg orientation: The number telling which orientation we want to\n"
206 " :type orientation: int\n"
207 " :arg level: The level of the pyramid in which we wish to read the\n"
209 " :type level: int\n"
210 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
211 " is in the lower-left corner.\n"
213 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
214 " is in the lower-left corner.\n"
216 " :return: The floating-point value stored for that pixel.\n"
223 static const char *kwlist[] = {
"orientation",
"level",
"x",
"y",
nullptr};
224 int orientation, level;
227 if (!PyArg_ParseTupleAndKeywords(
228 args, kwds,
"iiII", (
char **)kwlist, &orientation, &level, &x, &y))
232 return PyFloat_FromDouble(
238 ContextFunctions_get_selected_fedge___doc__,
239 ".. function:: get_selected_fedge()\n"
241 " Returns the selected FEdge.\n"
243 " :return: The selected FEdge.\n"
244 " :rtype: :class:`FEdge`\n");
260 "The Blender Freestyle.ContextFunctions submodule\n"
269 ContextFunctions_get_time_stamp___doc__},
273 ContextFunctions_get_canvas_width___doc__},
274 {
"get_canvas_height",
277 ContextFunctions_get_canvas_height___doc__},
281 ContextFunctions_get_border___doc__},
284 METH_VARARGS | METH_KEYWORDS,
285 ContextFunctions_load_map___doc__},
288 METH_VARARGS | METH_KEYWORDS,
289 ContextFunctions_read_map_pixel___doc__},
290 {
"read_complete_view_map_pixel",
292 METH_VARARGS | METH_KEYWORDS,
293 ContextFunctions_read_complete_view_map_pixel___doc__},
294 {
"read_directional_view_map_pixel",
296 METH_VARARGS | METH_KEYWORDS,
297 ContextFunctions_read_directional_view_map_pixel___doc__},
298 {
"get_selected_fedge",
301 ContextFunctions_get_selected_fedge___doc__},
302 {
nullptr,
nullptr, 0,
nullptr},
308 PyModuleDef_HEAD_INIT,
309 "Freestyle.ContextFunctions",
333 PyModule_AddObjectRef(
module,
"ContextFunctions", m);
static PyObject * ContextFunctions_get_canvas_height(PyObject *)
static PyObject * ContextFunctions_load_map(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * ContextFunctions_read_directional_view_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * ContextFunctions_read_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * ContextFunctions_get_border(PyObject *)
static PyModuleDef module_definition
static PyObject * ContextFunctions_get_canvas_width(PyObject *)
PyDoc_STRVAR(ContextFunctions_get_time_stamp___doc__, ".. function:: get_time_stamp()\n" "\n" " Returns the system time stamp.\n" "\n" " :return: The system time stamp.\n" " :rtype: int\n")
static PyObject * ContextFunctions_get_time_stamp(PyObject *)
static PyObject * ContextFunctions_get_selected_fedge(PyObject *)
static PyObject * ContextFunctions_read_complete_view_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
int ContextFunctions_Init(PyObject *module)
static PyMethodDef module_functions[]
PyObject * Any_BPy_FEdge_from_FEdge(FEdge &fe)
Functions related to context queries.
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Point & getMin() const
const Point & getMax() const
void LoadMapCF(const char *iFileName, const char *iMapName, uint iNbLevels, float iSigma)
FEdge * GetSelectedFEdgeCF()
float ReadDirectionalViewMapPixelCF(int iOrientation, int level, uint x, uint y)
float ReadCompleteViewMapPixelCF(int level, uint x, uint y)
float ReadMapPixelCF(const char *iMapName, int level, uint x, uint y)
BBox< Vec2i > GetBorderCF()
static struct PyModuleDef module
#define PyTuple_SET_ITEMS(op_arg,...)