2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* ***** END GPL LICENSE BLOCK *****
21
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp
25
#include "BPy_ColorNoiseShader.h"
27
#include "../../stroke/BasicStrokeShaders.h"
33
///////////////////////////////////////////////////////////////////////////////////////////
35
//------------------------INSTANCE METHODS ----------------------------------
37
static char ColorNoiseShader___doc__[] =
38
"Class hierarchy: :class:`StrokeShader` > :class:`ColorNoiseShader`\n"
42
".. method:: __init__(amplitude, period)\n"
44
" Builds a ColorNoiseShader object.\n"
46
" :arg amplitude: The amplitude of the noise signal.\n"
47
" :type amplitude: float\n"
48
" :arg period: The period of the noise signal.\n"
49
" :type period: float\n"
51
".. method:: shade(stroke)\n"
53
" Shader to add noise to the stroke colors.\n"
55
" :arg stroke: A Stroke object.\n"
56
" :type stroke: :class:`Stroke`\n";
58
static int ColorNoiseShader___init__(BPy_ColorNoiseShader *self, PyObject *args, PyObject *kwds)
60
static const char *kwlist[] = {"amplitude", "period", NULL};
63
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2))
65
self->py_ss.ss = new StrokeShaders::ColorNoiseShader(f1, f2);
69
/*-----------------------BPy_ColorNoiseShader type definition ------------------------------*/
71
PyTypeObject ColorNoiseShader_Type = {
72
PyVarObject_HEAD_INIT(NULL, 0)
73
"ColorNoiseShader", /* tp_name */
74
sizeof(BPy_ColorNoiseShader), /* tp_basicsize */
83
0, /* tp_as_sequence */
84
0, /* tp_as_mapping */
91
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
92
ColorNoiseShader___doc__, /* tp_doc */
95
0, /* tp_richcompare */
96
0, /* tp_weaklistoffset */
102
&StrokeShader_Type, /* tp_base */
104
0, /* tp_descr_get */
105
0, /* tp_descr_set */
106
0, /* tp_dictoffset */
107
(initproc)ColorNoiseShader___init__, /* tp_init */
112
///////////////////////////////////////////////////////////////////////////////////////////