remove/comment unused defines.
[blender.git] / source / blender / blenkernel / BKE_brush.h
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  * General operations for brushes.
29  */
30
31 #ifndef BKE_BRUSH_H
32 #define BKE_BRUSH_H
33
34 struct ID;
35 struct Brush;
36 struct ImBuf;
37 struct Scene;
38 struct wmOperator;
39 // enum CurveMappingPreset;
40
41 /* datablock functions */
42 struct Brush *add_brush(const char *name);
43 struct Brush *copy_brush(struct Brush *brush);
44 void make_local_brush(struct Brush *brush);
45 void free_brush(struct Brush *brush);
46
47 void brush_reset_sculpt(struct Brush *brush);
48
49 /* image icon function */
50 struct ImBuf *get_brush_icon(struct Brush *brush);
51
52 /* brush library operations used by different paint panels */
53 int brush_delete(struct Brush **current_brush);
54 int brush_texture_set_nr(struct Brush *brush, int nr);
55 int brush_texture_delete(struct Brush *brush);
56 int brush_clone_image_set_nr(struct Brush *brush, int nr);
57 int brush_clone_image_delete(struct Brush *brush);
58
59 /* jitter */
60 void brush_jitter_pos(struct Brush *brush, float *pos, float *jitterpos);
61
62 /* brush curve */
63 void brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
64 float brush_curve_strength_clamp(struct Brush *br, float p, const float len);
65 float brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
66
67 /* sampling */
68 void brush_sample_tex(struct Brush *brush, float *xy, float *rgba, const int thread);
69 void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
70         struct ImBuf **imbuf);
71
72 /* painting */
73 struct BrushPainter;
74 typedef struct BrushPainter BrushPainter;
75 typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
76
77 BrushPainter *brush_painter_new(struct Brush *brush);
78 void brush_painter_require_imbuf(BrushPainter *painter, short flt,
79         short texonly, int size);
80 int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
81         double time, float pressure, void *user);
82 void brush_painter_break_stroke(BrushPainter *painter);
83 void brush_painter_free(BrushPainter *painter);
84
85 /* texture */
86 unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
87
88 /* radial control */
89 void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br, float size_weight);
90 int brush_radial_control_exec(struct wmOperator *op, struct Brush *br, float size_weight);
91
92 /* unified strength and size */
93
94 int  brush_size(struct Brush *brush);
95 void brush_set_size(struct Brush *brush, int value);
96
97 int  brush_use_locked_size(struct Brush *brush);
98 void brush_set_use_locked_size(struct Brush *brush, int value);
99
100 int  brush_use_alpha_pressure(struct Brush *brush);
101 void brush_set_use_alpha_pressure(struct Brush *brush, int value);
102
103 int  brush_use_size_pressure(struct Brush *brush);
104 void brush_set_use_size_pressure(struct Brush *brush, int value);
105
106 float brush_unprojected_radius(struct Brush *brush);
107 void  brush_set_unprojected_radius(struct Brush *brush, float value);
108
109 float brush_alpha(struct Brush *brush);
110 void  brush_set_alpha(struct Brush *brush, float value);
111
112 #endif
113