10 #include "../stroke/ContextFunctions.h"
23 ".. function:: get_time_stamp()\n"
25 " Returns the system time stamp.\n"
27 " :return: The system time stamp.\n"
36 ".. method:: get_canvas_width()\n"
38 " Returns the canvas width.\n"
40 " :return: The canvas width.\n"
49 ".. method:: get_canvas_height()\n"
51 " Returns the canvas height.\n"
53 " :return: The canvas height.\n"
62 ".. method:: get_border()\n"
64 " Returns the border.\n"
66 " :return: A tuple of 4 numbers (xmin, ymin, xmax, ymax).\n"
72 PyObject *
v = PyTuple_New(4);
74 PyLong_FromLong(
border.getMin().x()),
75 PyLong_FromLong(
border.getMin().y()),
76 PyLong_FromLong(
border.getMax().x()),
77 PyLong_FromLong(
border.getMax().y()));
82 ".. function:: load_map(file_name, map_name, num_levels=4, sigma=1.0)\n"
84 " Loads an image map for further reading.\n"
86 " :arg file_name: The name of the image file.\n"
87 " :type file_name: str\n"
88 " :arg map_name: The name that will be used to access this image.\n"
89 " :type map_name: str\n"
90 " :arg num_levels: The number of levels in the map pyramid\n"
91 " (default = 4). If num_levels == 0, the complete pyramid is\n"
93 " :type num_levels: int\n"
94 " :arg sigma: The sigma value of the gaussian function.\n"
95 " :type sigma: float\n";
99 static const char *kwlist[] = {
"file_name",
"map_name",
"num_levels",
"sigma",
nullptr};
100 char *fileName, *mapName;
101 unsigned nbLevels = 4;
104 if (!PyArg_ParseTupleAndKeywords(
105 args, kwds,
"ss|If", (
char **)kwlist, &fileName, &mapName, &nbLevels, &sigma)) {
113 ".. function:: read_map_pixel(map_name, level, x, y)\n"
115 " Reads a pixel in a user-defined map.\n"
117 " :arg map_name: The name of the map.\n"
118 " :type map_name: str\n"
119 " :arg level: The level of the pyramid in which we wish to read the\n"
121 " :type level: int\n"
122 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
123 " is in the lower-left corner.\n"
125 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
126 " is in the lower-left corner.\n"
128 " :return: The floating-point value stored for that pixel.\n"
135 static const char *kwlist[] = {
"map_name",
"level",
"x",
"y",
nullptr};
140 if (!PyArg_ParseTupleAndKeywords(
141 args, kwds,
"siII", (
char **)kwlist, &mapName, &level, &
x, &
y)) {
148 ".. function:: read_complete_view_map_pixel(level, x, y)\n"
150 " Reads a pixel in the complete view map.\n"
152 " :arg level: The level of the pyramid in which we wish to read the\n"
154 " :type level: int\n"
155 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
156 " is in the lower-left corner.\n"
158 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
159 " is in the lower-left corner.\n"
161 " :return: The floating-point value stored for that pixel.\n"
168 static const char *kwlist[] = {
"level",
"x",
"y",
nullptr};
172 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"iII", (
char **)kwlist, &level, &
x, &
y)) {
179 ".. function:: read_directional_view_map_pixel(orientation, level, x, y)\n"
181 " Reads a pixel in one of the oriented view map images.\n"
183 " :arg orientation: The number telling which orientation we want to\n"
185 " :type orientation: int\n"
186 " :arg level: The level of the pyramid in which we wish to read the\n"
188 " :type level: int\n"
189 " :arg x: The x coordinate of the pixel we wish to read. The origin\n"
190 " is in the lower-left corner.\n"
192 " :arg y: The y coordinate of the pixel we wish to read. The origin\n"
193 " is in the lower-left corner.\n"
195 " :return: The floating-point value stored for that pixel.\n"
202 static const char *kwlist[] = {
"orientation",
"level",
"x",
"y",
nullptr};
203 int orientation, level;
206 if (!PyArg_ParseTupleAndKeywords(
207 args, kwds,
"iiII", (
char **)kwlist, &orientation, &level, &
x, &
y)) {
210 return PyFloat_FromDouble(
215 ".. function:: get_selected_fedge()\n"
217 " Returns the selected FEdge.\n"
219 " :return: The selected FEdge.\n"
220 " :rtype: :class:`FEdge`\n";
246 {
"get_canvas_height",
256 METH_VARARGS | METH_KEYWORDS,
260 METH_VARARGS | METH_KEYWORDS,
262 {
"read_complete_view_map_pixel",
264 METH_VARARGS | METH_KEYWORDS,
266 {
"read_directional_view_map_pixel",
268 METH_VARARGS | METH_KEYWORDS,
270 {
"get_selected_fedge",
274 {
nullptr,
nullptr, 0,
nullptr},
280 PyModuleDef_HEAD_INIT,
281 "Freestyle.ContextFunctions",
302 PyModule_AddObject(
module,
"ContextFunctions", m);
static char ContextFunctions_get_border___doc__[]
static PyObject * ContextFunctions_load_map(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * ContextFunctions_get_canvas_height(PyObject *)
static char ContextFunctions_get_time_stamp___doc__[]
static PyObject * ContextFunctions_get_canvas_width(PyObject *)
static PyObject * ContextFunctions_get_border(PyObject *)
static char ContextFunctions_read_complete_view_map_pixel___doc__[]
static char ContextFunctions_read_map_pixel___doc__[]
static PyObject * ContextFunctions_get_time_stamp(PyObject *)
static PyObject * ContextFunctions_read_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
static PyModuleDef module_definition
static char module_docstring[]
static char ContextFunctions_read_directional_view_map_pixel___doc__[]
static PyObject * ContextFunctions_read_directional_view_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * ContextFunctions_read_complete_view_map_pixel(PyObject *, PyObject *args, PyObject *kwds)
static char ContextFunctions_load_map___doc__[]
int ContextFunctions_Init(PyObject *module)
static PyObject * ContextFunctions_get_selected_fedge(PyObject *)
static char ContextFunctions_get_canvas_width___doc__[]
static PyMethodDef module_functions[]
static char ContextFunctions_get_canvas_height___doc__[]
static char ContextFunctions_get_selected_fedge___doc__[]
PyObject * Any_BPy_FEdge_from_FEdge(FEdge &fe)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
ATTR_WARN_UNUSED_RESULT const BMVert * v
IconTextureDrawCall border
unsigned GetCanvasWidthCF()
float ReadCompleteViewMapPixelCF(int level, unsigned x, unsigned y)
FEdge * GetSelectedFEdgeCF()
float ReadDirectionalViewMapPixelCF(int iOrientation, int level, unsigned x, unsigned y)
void LoadMapCF(const char *iFileName, const char *iMapName, unsigned iNbLevels, float iSigma)
unsigned GetCanvasHeightCF()
BBox< Vec2i > GetBorderCF()
unsigned GetTimeStampCF()
float ReadMapPixelCF(const char *iMapName, int level, unsigned x, unsigned y)
static struct PyModuleDef module
#define PyTuple_SET_ITEMS(op_arg,...)