4 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
28 * General operations for brushes.
40 /* datablock functions */
41 struct Brush *add_brush(char *name);
42 struct Brush *copy_brush(struct Brush *brush);
43 void make_local_brush(struct Brush *brush);
44 void free_brush(struct Brush *brush);
46 /* brush library operations used by different paint panels */
47 struct Brush **current_brush_source(struct Scene *sce);
48 int brush_set_nr(struct Brush **current_brush, int nr);
49 int brush_delete(struct Brush **current_brush);
50 void brush_check_exists(struct Brush **brush);
51 void brush_toggled_fake_user(struct Brush *brush);
52 int brush_texture_set_nr(struct Brush *brush, int nr);
53 int brush_texture_delete(struct Brush *brush);
54 int brush_clone_image_set_nr(struct Brush *brush, int nr);
55 int brush_clone_image_delete(struct Brush *brush);
63 void brush_curve_preset(struct Brush *b, BrushCurvePreset preset);
64 float brush_curve_strength(struct Brush *br, float p, const float len);
67 float brush_sample_falloff(struct Brush *brush, float dist);
68 float brush_sample_falloff_noalpha(struct Brush *brush, float dist);
69 void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
70 void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
71 struct ImBuf **imbuf);
75 typedef struct BrushPainter BrushPainter;
76 typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
78 BrushPainter *brush_painter_new(struct Brush *brush);
79 void brush_painter_require_imbuf(BrushPainter *painter, short flt,
80 short texonly, int size);
81 int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
82 double time, float pressure, void *user);
83 void brush_painter_break_stroke(BrushPainter *painter);
84 void brush_painter_free(BrushPainter *painter);
87 unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
90 void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br, float size_weight);
91 int brush_radial_control_exec(struct wmOperator *op, struct Brush *br, float size_weight);