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