-
Notifications
You must be signed in to change notification settings - Fork 86
/
mypaint-brush.h
115 lines (83 loc) · 3.5 KB
/
mypaint-brush.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef MYPAINTBRUSH_H
#define MYPAINTBRUSH_H
/* libmypaint - The MyPaint Brush Library
* Copyright (C) 2008 Martin Renold <[email protected]>
* Copyright (C) 2012 Jon Nordby <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "mypaint-config.h"
#include "mypaint-surface.h"
#include "mypaint-brush-settings.h"
G_BEGIN_DECLS
typedef struct MyPaintBrush MyPaintBrush;
MyPaintBrush *
mypaint_brush_new(void);
MyPaintBrush *
mypaint_brush_new_with_buckets(int num_smudge_buckets);
void
mypaint_brush_unref(MyPaintBrush *self);
void
mypaint_brush_ref(MyPaintBrush *self);
void
mypaint_brush_reset(MyPaintBrush *self);
void
mypaint_brush_new_stroke(MyPaintBrush *self);
int
mypaint_brush_stroke_to(MyPaintBrush *self, MyPaintSurface *surface, float x, float y,
float pressure, float xtilt, float ytilt, double dtime, float viewzoom,
float viewrotation, float barrel_rotation, gboolean linear);
void
mypaint_brush_set_base_value(MyPaintBrush *self, MyPaintBrushSetting id, float value);
float
mypaint_brush_get_base_value(MyPaintBrush *self, MyPaintBrushSetting id);
gboolean
mypaint_brush_is_constant(MyPaintBrush *self, MyPaintBrushSetting id);
int
mypaint_brush_get_inputs_used_n(MyPaintBrush *self, MyPaintBrushSetting id);
void
mypaint_brush_set_mapping_n(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int n);
int
mypaint_brush_get_mapping_n(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input);
void
mypaint_brush_set_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float x, float y);
void
mypaint_brush_get_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float *x, float *y);
float
mypaint_brush_get_state(MyPaintBrush *self, MyPaintBrushState i);
void
mypaint_brush_set_state(MyPaintBrush *self, MyPaintBrushState i, float value);
gboolean
mypaint_brush_set_smudge_bucket_state(
MyPaintBrush* self, int bucket_index,
float r, float g, float b, float a,
float prev_r, float prev_g, float prev_b, float prev_a,
float prev_color_recentness);
gboolean
mypaint_brush_get_smudge_bucket_state(
const MyPaintBrush* self, int bucket_index,
float* r, float* g, float* b, float* a,
float* prev_r, float* prev_g, float* prev_b, float* prev_a,
float* prev_color_recentness);
int mypaint_brush_get_min_smudge_bucket_used(const MyPaintBrush* self);
int mypaint_brush_get_max_smudge_bucket_used(const MyPaintBrush* self);
double
mypaint_brush_get_total_stroke_painting_time(MyPaintBrush *self);
void
mypaint_brush_set_print_inputs(MyPaintBrush *self, gboolean enabled);
void
mypaint_brush_from_defaults(MyPaintBrush *self);
gboolean
mypaint_brush_from_string(MyPaintBrush *self, const char *string);
G_END_DECLS
#endif // MYPAINTBRUSH_H