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