OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 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. |
| 8 * |
| 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. |
| 13 * |
| 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. |
| 17 * |
| 18 * The Original Code is Copyright (C) 2010 Blender Foundation. |
| 19 * All rights reserved. |
| 20 * |
| 21 * The Original Code is: all of this file. |
| 22 * |
| 23 * Contributor(s): none yet. |
| 24 * |
| 25 * ***** END GPL LICENSE BLOCK ***** |
| 26 */ |
| 27 |
| 28 /** \file source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColo
rShader.cpp |
| 29 * \ingroup freestyle |
| 30 */ |
| 31 |
| 32 #include "BPy_IncreasingColorShader.h" |
| 33 |
| 34 #include "../../stroke/BasicStrokeShaders.h" |
| 35 |
| 36 #ifdef __cplusplus |
| 37 extern "C" { |
| 38 #endif |
| 39 |
| 40 ////////////////////////////////////////////////////////////////////////////////
/////////// |
| 41 |
| 42 //------------------------INSTANCE METHODS ---------------------------------- |
| 43 |
| 44 static char IncreasingColorShader___doc__[] = |
| 45 "Class hierarchy: :class:`StrokeShader` > :class:`IncreasingColorShader`\n" |
| 46 "\n" |
| 47 "[Color shader]\n" |
| 48 "\n" |
| 49 ".. method:: __init__(red_min, green_min, blue_min, alpha_min, red_max, green_ma
x, blue_max, alpha_max)\n" |
| 50 "\n" |
| 51 " Builds an IncreasingColorShader object.\n" |
| 52 "\n" |
| 53 " :arg red_min: The first color red component.\n" |
| 54 " :type red_min: float\n" |
| 55 " :arg green_min: The first color green component.\n" |
| 56 " :type green_min: float\n" |
| 57 " :arg blue_min: The first color blue component.\n" |
| 58 " :type blue_min: float\n" |
| 59 " :arg alpha_min: The first color alpha value.\n" |
| 60 " :type alpha_min: float\n" |
| 61 " :arg red_max: The second color red component.\n" |
| 62 " :type red_max: float\n" |
| 63 " :arg green_max: The second color green component.\n" |
| 64 " :type green_max: float\n" |
| 65 " :arg blue_max: The second color blue component.\n" |
| 66 " :type blue_max: float\n" |
| 67 " :arg alpha_max: The second color alpha value.\n" |
| 68 " :type alpha_max: float\n" |
| 69 "\n" |
| 70 ".. method:: shade(stroke)\n" |
| 71 "\n" |
| 72 " Assigns a varying color to the stroke. The user specifies two\n" |
| 73 " colors A and B. The stroke color will change linearly from A to B\n" |
| 74 " between the first and the last vertex.\n" |
| 75 "\n" |
| 76 " :arg stroke: A Stroke object.\n" |
| 77 " :type stroke: :class:`Stroke`\n"; |
| 78 |
| 79 static int IncreasingColorShader___init__(BPy_IncreasingColorShader* self, PyObj
ect *args, PyObject *kwds) |
| 80 { |
| 81 static const char *kwlist[] = {"red_min", "green_min", "blue_min", "alph
a_min", |
| 82 "red_max", "green_max", "blue_max", "alph
a_max", NULL}; |
| 83 float f1, f2, f3, f4, f5, f6, f7, f8; |
| 84 |
| 85 if (!PyArg_ParseTupleAndKeywords(args, kwds, "ffffffff", (char **)kwlist
, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) |
| 86 return -1; |
| 87 self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4
, f5, f6, f7, f8); |
| 88 return 0; |
| 89 } |
| 90 |
| 91 /*-----------------------BPy_IncreasingColorShader type definition -------------
-----------------*/ |
| 92 |
| 93 PyTypeObject IncreasingColorShader_Type = { |
| 94 PyVarObject_HEAD_INIT(NULL, 0) |
| 95 "IncreasingColorShader", /* tp_name */ |
| 96 sizeof(BPy_IncreasingColorShader), /* tp_basicsize */ |
| 97 0, /* tp_itemsize */ |
| 98 0, /* tp_dealloc */ |
| 99 0, /* tp_print */ |
| 100 0, /* tp_getattr */ |
| 101 0, /* tp_setattr */ |
| 102 0, /* tp_reserved */ |
| 103 0, /* tp_repr */ |
| 104 0, /* tp_as_number */ |
| 105 0, /* tp_as_sequence */ |
| 106 0, /* tp_as_mapping */ |
| 107 0, /* tp_hash */ |
| 108 0, /* tp_call */ |
| 109 0, /* tp_str */ |
| 110 0, /* tp_getattro */ |
| 111 0, /* tp_setattro */ |
| 112 0, /* tp_as_buffer */ |
| 113 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ |
| 114 IncreasingColorShader___doc__, /* tp_doc */ |
| 115 0, /* tp_traverse */ |
| 116 0, /* tp_clear */ |
| 117 0, /* tp_richcompare */ |
| 118 0, /* tp_weaklistoffset */ |
| 119 0, /* tp_iter */ |
| 120 0, /* tp_iternext */ |
| 121 0, /* tp_methods */ |
| 122 0, /* tp_members */ |
| 123 0, /* tp_getset */ |
| 124 &StrokeShader_Type, /* tp_base */ |
| 125 0, /* tp_dict */ |
| 126 0, /* tp_descr_get */ |
| 127 0, /* tp_descr_set */ |
| 128 0, /* tp_dictoffset */ |
| 129 (initproc)IncreasingColorShader___init__, /* tp_init */ |
| 130 0, /* tp_alloc */ |
| 131 0, /* tp_new */ |
| 132 }; |
| 133 |
| 134 ////////////////////////////////////////////////////////////////////////////////
/////////// |
| 135 |
| 136 #ifdef __cplusplus |
| 137 } |
| 138 #endif |
OLD | NEW |