~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_brush.h

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: BKE_brush.h 14444 2008-04-16 22:40:48Z hos $
 
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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
 
 
38
/* datablock functions */
 
39
struct Brush *add_brush(char *name);
 
40
struct Brush *copy_brush(struct Brush *brush);
 
41
void make_local_brush(struct Brush *brush);
 
42
void free_brush(struct Brush *brush);
 
43
 
 
44
/* brush library operations used by different paint panels */
 
45
int brush_set_nr(struct Brush **current_brush, int nr);
 
46
int brush_delete(struct Brush **current_brush);
 
47
void brush_check_exists(struct Brush **brush);
 
48
void brush_toggled_fake_user(struct Brush *brush);
 
49
int brush_texture_set_nr(struct Brush *brush, int nr);
 
50
int brush_texture_delete(struct Brush *brush);
 
51
int brush_clone_image_set_nr(struct Brush *brush, int nr);
 
52
int brush_clone_image_delete(struct Brush *brush);
 
53
 
 
54
/* sampling */
 
55
float brush_sample_falloff(struct Brush *brush, float dist);
 
56
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
 
57
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
 
58
        struct ImBuf **imbuf);
 
59
 
 
60
/* painting */
 
61
struct BrushPainter;
 
62
typedef struct BrushPainter BrushPainter;
 
63
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
 
64
 
 
65
BrushPainter *brush_painter_new(struct Brush *brush);
 
66
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
 
67
        short texonly, int size);
 
68
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
 
69
        double time, float pressure, void *user);
 
70
void brush_painter_break_stroke(BrushPainter *painter);
 
71
void brush_painter_free(BrushPainter *painter);
 
72
 
 
73
#endif
 
74