Blender  V3.3
BPy_ColorNoiseShader.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BPy_ColorNoiseShader.h"
8 
9 #include "../../stroke/BasicStrokeShaders.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
21 static char ColorNoiseShader___doc__[] =
22  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ColorNoiseShader`\n"
23  "\n"
24  "[Color shader]\n"
25  "\n"
26  ".. method:: __init__(amplitude, period)\n"
27  "\n"
28  " Builds a ColorNoiseShader object.\n"
29  "\n"
30  " :arg amplitude: The amplitude of the noise signal.\n"
31  " :type amplitude: float\n"
32  " :arg period: The period of the noise signal.\n"
33  " :type period: float\n"
34  "\n"
35  ".. method:: shade(stroke)\n"
36  "\n"
37  " Shader to add noise to the stroke colors.\n"
38  "\n"
39  " :arg stroke: A Stroke object.\n"
40  " :type stroke: :class:`freestyle.types.Stroke`\n";
41 
42 static int ColorNoiseShader___init__(BPy_ColorNoiseShader *self, PyObject *args, PyObject *kwds)
43 {
44  static const char *kwlist[] = {"amplitude", "period", nullptr};
45  float f1, f2;
46 
47  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) {
48  return -1;
49  }
50  self->py_ss.ss = new StrokeShaders::ColorNoiseShader(f1, f2);
51  return 0;
52 }
53 
54 /*-----------------------BPy_ColorNoiseShader type definition ------------------------------*/
55 
56 PyTypeObject ColorNoiseShader_Type = {
57  PyVarObject_HEAD_INIT(nullptr, 0) "ColorNoiseShader", /* tp_name */
58  sizeof(BPy_ColorNoiseShader), /* tp_basicsize */
59  0, /* tp_itemsize */
60  nullptr, /* tp_dealloc */
61  0, /* tp_vectorcall_offset */
62  nullptr, /* tp_getattr */
63  nullptr, /* tp_setattr */
64  nullptr, /* tp_reserved */
65  nullptr, /* tp_repr */
66  nullptr, /* tp_as_number */
67  nullptr, /* tp_as_sequence */
68  nullptr, /* tp_as_mapping */
69  nullptr, /* tp_hash */
70  nullptr, /* tp_call */
71  nullptr, /* tp_str */
72  nullptr, /* tp_getattro */
73  nullptr, /* tp_setattro */
74  nullptr, /* tp_as_buffer */
75  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
76  ColorNoiseShader___doc__, /* tp_doc */
77  nullptr, /* tp_traverse */
78  nullptr, /* tp_clear */
79  nullptr, /* tp_richcompare */
80  0, /* tp_weaklistoffset */
81  nullptr, /* tp_iter */
82  nullptr, /* tp_iternext */
83  nullptr, /* tp_methods */
84  nullptr, /* tp_members */
85  nullptr, /* tp_getset */
86  &StrokeShader_Type, /* tp_base */
87  nullptr, /* tp_dict */
88  nullptr, /* tp_descr_get */
89  nullptr, /* tp_descr_set */
90  0, /* tp_dictoffset */
91  (initproc)ColorNoiseShader___init__, /* tp_init */
92  nullptr, /* tp_alloc */
93  nullptr, /* tp_new */
94 };
95 
97 
98 #ifdef __cplusplus
99 }
100 #endif
static int ColorNoiseShader___init__(BPy_ColorNoiseShader *self, PyObject *args, PyObject *kwds)
static char ColorNoiseShader___doc__[]
PyTypeObject ColorNoiseShader_Type
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:18