Blender  V3.3
BPy_IncreasingColorShader.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "../../stroke/BasicStrokeShaders.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
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  " :arg red_min: The first color red component.\n"
32  " :type red_min: float\n"
33  " :arg green_min: The first color green component.\n"
34  " :type green_min: float\n"
35  " :arg blue_min: The first color blue component.\n"
36  " :type blue_min: float\n"
37  " :arg alpha_min: The first color alpha value.\n"
38  " :type alpha_min: float\n"
39  " :arg red_max: The second color red component.\n"
40  " :type red_max: float\n"
41  " :arg green_max: The second color green component.\n"
42  " :type green_max: float\n"
43  " :arg blue_max: The second color blue component.\n"
44  " :type blue_max: float\n"
45  " :arg 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  " :arg stroke: A Stroke object.\n"
55  " :type stroke: :class:`freestyle.types.Stroke`\n";
56 
58  PyObject *args,
59  PyObject *kwds)
60 {
61  static const char *kwlist[] = {
62  "red_min",
63  "green_min",
64  "blue_min",
65  "alpha_min",
66  "red_max",
67  "green_max",
68  "blue_max",
69  "alpha_max",
70  nullptr,
71  };
72  float f1, f2, f3, f4, f5, f6, f7, f8;
73 
74  if (!PyArg_ParseTupleAndKeywords(
75  args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) {
76  return -1;
77  }
78  self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8);
79  return 0;
80 }
81 
82 /*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/
83 
85  PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingColorShader", /* tp_name */
86  sizeof(BPy_IncreasingColorShader), /* tp_basicsize */
87  0, /* tp_itemsize */
88  nullptr, /* tp_dealloc */
89  0, /* tp_vectorcall_offset */
90  nullptr, /* tp_getattr */
91  nullptr, /* tp_setattr */
92  nullptr, /* tp_reserved */
93  nullptr, /* tp_repr */
94  nullptr, /* tp_as_number */
95  nullptr, /* tp_as_sequence */
96  nullptr, /* tp_as_mapping */
97  nullptr, /* tp_hash */
98  nullptr, /* tp_call */
99  nullptr, /* tp_str */
100  nullptr, /* tp_getattro */
101  nullptr, /* tp_setattro */
102  nullptr, /* tp_as_buffer */
103  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
104  IncreasingColorShader___doc__, /* tp_doc */
105  nullptr, /* tp_traverse */
106  nullptr, /* tp_clear */
107  nullptr, /* tp_richcompare */
108  0, /* tp_weaklistoffset */
109  nullptr, /* tp_iter */
110  nullptr, /* tp_iternext */
111  nullptr, /* tp_methods */
112  nullptr, /* tp_members */
113  nullptr, /* tp_getset */
114  &StrokeShader_Type, /* tp_base */
115  nullptr, /* tp_dict */
116  nullptr, /* tp_descr_get */
117  nullptr, /* tp_descr_set */
118  0, /* tp_dictoffset */
119  (initproc)IncreasingColorShader___init__, /* tp_init */
120  nullptr, /* tp_alloc */
121  nullptr, /* tp_new */
122 };
123 
125 
126 #ifdef __cplusplus
127 }
128 #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:18