Blender V4.3
BPy_IncreasingColorShader.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2023 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 IncreasingColorShader___doc__,
26 "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingColorShader`\n"
27 "\n"
28 "[Color shader]\n"
29 "\n"
30 ".. method:: __init__(red_min, green_min, blue_min, alpha_min, red_max, green_max, blue_max, "
31 "alpha_max)\n"
32 "\n"
33 " Builds an IncreasingColorShader object.\n"
34 "\n"
35 " :arg red_min: The first color red component.\n"
36 " :type red_min: float\n"
37 " :arg green_min: The first color green component.\n"
38 " :type green_min: float\n"
39 " :arg blue_min: The first color blue component.\n"
40 " :type blue_min: float\n"
41 " :arg alpha_min: The first color alpha value.\n"
42 " :type alpha_min: float\n"
43 " :arg red_max: The second color red component.\n"
44 " :type red_max: float\n"
45 " :arg green_max: The second color green component.\n"
46 " :type green_max: float\n"
47 " :arg blue_max: The second color blue component.\n"
48 " :type blue_max: float\n"
49 " :arg alpha_max: The second color alpha value.\n"
50 " :type alpha_max: float\n"
51 "\n"
52 ".. method:: shade(stroke)\n"
53 "\n"
54 " Assigns a varying color to the stroke. The user specifies two\n"
55 " colors A and B. The stroke color will change linearly from A to B\n"
56 " between the first and the last vertex.\n"
57 "\n"
58 " :arg stroke: A Stroke object.\n"
59 " :type stroke: :class:`freestyle.types.Stroke`\n");
60
62 PyObject *args,
63 PyObject *kwds)
64{
65 static const char *kwlist[] = {
66 "red_min",
67 "green_min",
68 "blue_min",
69 "alpha_min",
70 "red_max",
71 "green_max",
72 "blue_max",
73 "alpha_max",
74 nullptr,
75 };
76 float f1, f2, f3, f4, f5, f6, f7, f8;
77
78 if (!PyArg_ParseTupleAndKeywords(
79 args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8))
80 {
81 return -1;
82 }
83 self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8);
84 return 0;
85}
86
87/*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/
88
90 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
91 /*tp_name*/ "IncreasingColorShader",
92 /*tp_basicsize*/ sizeof(BPy_IncreasingColorShader),
93 /*tp_itemsize*/ 0,
94 /*tp_dealloc*/ nullptr,
95 /*tp_vectorcall_offset*/ 0,
96 /*tp_getattr*/ nullptr,
97 /*tp_setattr*/ nullptr,
98 /*tp_as_async*/ nullptr,
99 /*tp_repr*/ nullptr,
100 /*tp_as_number*/ nullptr,
101 /*tp_as_sequence*/ nullptr,
102 /*tp_as_mapping*/ nullptr,
103 /*tp_hash*/ nullptr,
104 /*tp_call*/ nullptr,
105 /*tp_str*/ nullptr,
106 /*tp_getattro*/ nullptr,
107 /*tp_setattro*/ nullptr,
108 /*tp_as_buffer*/ nullptr,
109 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
110 /*tp_doc*/ IncreasingColorShader___doc__,
111 /*tp_traverse*/ nullptr,
112 /*tp_clear*/ nullptr,
113 /*tp_richcompare*/ nullptr,
114 /*tp_weaklistoffset*/ 0,
115 /*tp_iter*/ nullptr,
116 /*tp_iternext*/ nullptr,
117 /*tp_methods*/ nullptr,
118 /*tp_members*/ nullptr,
119 /*tp_getset*/ nullptr,
120 /*tp_base*/ &StrokeShader_Type,
121 /*tp_dict*/ nullptr,
122 /*tp_descr_get*/ nullptr,
123 /*tp_descr_set*/ nullptr,
124 /*tp_dictoffset*/ 0,
125 /*tp_init*/ (initproc)IncreasingColorShader___init__,
126 /*tp_alloc*/ nullptr,
127 /*tp_new*/ nullptr,
128};
129
131
132#ifdef __cplusplus
133}
134#endif
PyDoc_STRVAR(IncreasingColorShader___doc__, "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingColorShader`\n" "\n" "[Color shader]\n" "\n" ".. method:: __init__(red_min, green_min, blue_min, alpha_min, red_max, green_max, blue_max, " "alpha_max)\n" "\n" " Builds an IncreasingColorShader object.\n" "\n" " :arg red_min: The first color red component.\n" " :type red_min: float\n" " :arg green_min: The first color green component.\n" " :type green_min: float\n" " :arg blue_min: The first color blue component.\n" " :type blue_min: float\n" " :arg alpha_min: The first color alpha value.\n" " :type alpha_min: float\n" " :arg red_max: The second color red component.\n" " :type red_max: float\n" " :arg green_max: The second color green component.\n" " :type green_max: float\n" " :arg blue_max: The second color blue component.\n" " :type blue_max: float\n" " :arg alpha_max: The second color alpha value.\n" " :type alpha_max: float\n" "\n" ".. method:: shade(stroke)\n" "\n" " Assigns a varying color to the stroke. The user specifies two\n" " colors A and B. The stroke color will change linearly from A to B\n" " between the first and the last vertex.\n" "\n" " :arg stroke: A Stroke object.\n" " :type stroke: :class:`freestyle.types.Stroke`\n")
PyTypeObject IncreasingColorShader_Type
static int IncreasingColorShader___init__(BPy_IncreasingColorShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
Class gathering basic stroke shaders.
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20