Blender  V2.93
BPy_IncreasingColorShader.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
22 
23 #include "../../stroke/BasicStrokeShaders.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 using namespace Freestyle;
30 
32 
33 //------------------------INSTANCE METHODS ----------------------------------
34 
36  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingColorShader`\n"
37  "\n"
38  "[Color shader]\n"
39  "\n"
40  ".. method:: __init__(red_min, green_min, blue_min, alpha_min, red_max, green_max, blue_max, "
41  "alpha_max)\n"
42  "\n"
43  " Builds an IncreasingColorShader object.\n"
44  "\n"
45  " :arg red_min: The first color red component.\n"
46  " :type red_min: float\n"
47  " :arg green_min: The first color green component.\n"
48  " :type green_min: float\n"
49  " :arg blue_min: The first color blue component.\n"
50  " :type blue_min: float\n"
51  " :arg alpha_min: The first color alpha value.\n"
52  " :type alpha_min: float\n"
53  " :arg red_max: The second color red component.\n"
54  " :type red_max: float\n"
55  " :arg green_max: The second color green component.\n"
56  " :type green_max: float\n"
57  " :arg blue_max: The second color blue component.\n"
58  " :type blue_max: float\n"
59  " :arg alpha_max: The second color alpha value.\n"
60  " :type alpha_max: float\n"
61  "\n"
62  ".. method:: shade(stroke)\n"
63  "\n"
64  " Assigns a varying color to the stroke. The user specifies two\n"
65  " colors A and B. The stroke color will change linearly from A to B\n"
66  " between the first and the last vertex.\n"
67  "\n"
68  " :arg stroke: A Stroke object.\n"
69  " :type stroke: :class:`freestyle.types.Stroke`\n";
70 
72  PyObject *args,
73  PyObject *kwds)
74 {
75  static const char *kwlist[] = {
76  "red_min",
77  "green_min",
78  "blue_min",
79  "alpha_min",
80  "red_max",
81  "green_max",
82  "blue_max",
83  "alpha_max",
84  nullptr,
85  };
86  float f1, f2, f3, f4, f5, f6, f7, f8;
87 
88  if (!PyArg_ParseTupleAndKeywords(
89  args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) {
90  return -1;
91  }
92  self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8);
93  return 0;
94 }
95 
96 /*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/
97 
99  PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingColorShader", /* tp_name */
100  sizeof(BPy_IncreasingColorShader), /* tp_basicsize */
101  0, /* tp_itemsize */
102  nullptr, /* tp_dealloc */
103  0, /* tp_vectorcall_offset */
104  nullptr, /* tp_getattr */
105  nullptr, /* tp_setattr */
106  nullptr, /* tp_reserved */
107  nullptr, /* tp_repr */
108  nullptr, /* tp_as_number */
109  nullptr, /* tp_as_sequence */
110  nullptr, /* tp_as_mapping */
111  nullptr, /* tp_hash */
112  nullptr, /* tp_call */
113  nullptr, /* tp_str */
114  nullptr, /* tp_getattro */
115  nullptr, /* tp_setattro */
116  nullptr, /* tp_as_buffer */
117  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
118  IncreasingColorShader___doc__, /* tp_doc */
119  nullptr, /* tp_traverse */
120  nullptr, /* tp_clear */
121  nullptr, /* tp_richcompare */
122  0, /* tp_weaklistoffset */
123  nullptr, /* tp_iter */
124  nullptr, /* tp_iternext */
125  nullptr, /* tp_methods */
126  nullptr, /* tp_members */
127  nullptr, /* tp_getset */
128  &StrokeShader_Type, /* tp_base */
129  nullptr, /* tp_dict */
130  nullptr, /* tp_descr_get */
131  nullptr, /* tp_descr_set */
132  0, /* tp_dictoffset */
133  (initproc)IncreasingColorShader___init__, /* tp_init */
134  nullptr, /* tp_alloc */
135  nullptr, /* tp_new */
136 };
137 
139 
140 #ifdef __cplusplus
141 }
142 #endif
static char IncreasingColorShader___doc__[]
PyTypeObject IncreasingColorShader_Type
static int IncreasingColorShader___init__(BPy_IncreasingColorShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:32