3
* ***** BEGIN GPL LICENSE BLOCK *****
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software Foundation,
17
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
* The Original Code is Copyright (C) 2005 Blender Foundation.
20
* All rights reserved.
22
* The Original Code is: all of this file.
24
* Contributor(s): none yet.
26
* ***** END GPL LICENSE BLOCK *****
29
#include "../TEX_util.h"
31
/* **************** INVERT ******************** */
32
static bNodeSocketType inputs[]= {
33
{ SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
37
static bNodeSocketType outputs[]= {
38
{ SOCK_RGBA, 0, "Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
42
static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
46
tex_input_rgba(col, in[0], coord, thread);
48
col[0] = 1.0f - col[0];
49
col[1] = 1.0f - col[1];
50
col[2] = 1.0f - col[2];
56
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
58
tex_output(node, in, out[0], &colorfn);
60
tex_do_preview(node, out[0], data);
63
bNodeType tex_node_invert= {
64
/* *next,*prev */ NULL, NULL,
65
/* type code */ TEX_NODE_INVERT,
67
/* width+range */ 90, 80, 100,
68
/* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
69
/* input sock */ inputs,
70
/* output sock */ outputs,
75
/* freestoragefunc */ NULL,
76
/* copystoragefunc */ NULL,