libmypaint  1.6.0
mypaint-brush.h
Go to the documentation of this file.
1 #ifndef MYPAINTBRUSH_H
2 #define MYPAINTBRUSH_H
3 
4 /* libmypaint - The MyPaint Brush Library
5  * Copyright (C) 2008 Martin Renold <martinxyz@gmx.ch>
6  * Copyright (C) 2012 Jon Nordby <jononor@gmail.com>
7  *
8  * Permission to use, copy, modify, and/or distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #include "mypaint-config.h"
22 #include "mypaint-surface.h"
23 #include "mypaint-brush-settings.h"
24 
38 typedef struct MyPaintBrush MyPaintBrush;
39 
46 mypaint_brush_new(void);
47 
61 mypaint_brush_new_with_buckets(int num_smudge_buckets);
62 
70 void
72 
80 void
82 
94 void
96 
106 void
108 
114 int
116  MyPaintBrush* self, MyPaintSurface* surface, float x, float y, float pressure, float xtilt, float ytilt,
117  double dtime);
118 
124 int
126  MyPaintBrush* self, MyPaintSurface2* surface, float x, float y, float pressure, float xtilt, float ytilt,
127  double dtime, float viewzoom, float viewrotation, float barrel_rotation);
128 
142 int
144  MyPaintBrush* self, MyPaintSurface2* surface, float x, float y, float pressure, float xtilt, float ytilt,
145  double dtime, float viewzoom, float viewrotation, float barrel_rotation);
146 
152 void
154 
160 float
162 
171 gboolean
173 
179 int
181 
187 void
189 
195 int
197 
203 void
204 mypaint_brush_set_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float x, float y);
205 
211 void
212 mypaint_brush_get_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float *x, float *y);
213 
219 float
221 
227 void
229 
235 double
237 
243 void
245 
251 void
253 
254 
260 gboolean
261 mypaint_brush_from_string(MyPaintBrush *self, const char *string);
262 
263 
265 
266 #endif // MYPAINTBRUSH_H
MyPaintBrush::mypaint_brush_get_mapping_point
void mypaint_brush_get_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float *x, float *y)
Get the coordinates of a point in an input mapping for a brush setting.
MyPaintBrush::mypaint_brush_stroke_to
int mypaint_brush_stroke_to(MyPaintBrush *self, MyPaintSurface *surface, float x, float y, float pressure, float xtilt, float ytilt, double dtime)
Use the brush to draw a stroke segment on a MyPaintSurface.
MyPaintBrush::mypaint_brush_reset
void mypaint_brush_reset(MyPaintBrush *self)
Request a reset if the brush state.
MyPaintBrush::mypaint_brush_ref
void mypaint_brush_ref(MyPaintBrush *self)
Increase the reference count by one.
gboolean
gint gboolean
Definition: mypaint-glib-compat.h:25
MyPaintBrush::mypaint_brush_set_base_value
void mypaint_brush_set_base_value(MyPaintBrush *self, MyPaintBrushSetting id, float value)
Set the base value of a brush setting.
MyPaintBrush::mypaint_brush_set_state
void mypaint_brush_set_state(MyPaintBrush *self, MyPaintBrushState i, float value)
Set the value of a brush state.
MyPaintBrush
mypaint-config.h
MyPaintBrush::mypaint_brush_is_constant
gboolean mypaint_brush_is_constant(MyPaintBrush *self, MyPaintBrushSetting id)
Check if there are no dynamics/mappings for a brush setting.
MyPaintBrush::mypaint_brush_get_total_stroke_painting_time
double mypaint_brush_get_total_stroke_painting_time(MyPaintBrush *self)
Get the total time recorded since the last call to mypaint_brush_reset.
MyPaintSurface
Abstract surface type for the MyPaint brush engine.
Definition: mypaint-surface.h:131
mypaint-surface.h
MyPaintBrush::mypaint_brush_get_base_value
float mypaint_brush_get_base_value(MyPaintBrush *self, MyPaintBrushSetting id)
Get the base value of a brush setting.
MyPaintBrush::mypaint_brush_get_state
float mypaint_brush_get_state(MyPaintBrush *self, MyPaintBrushState i)
Get the value of a brush state.
MyPaintBrush::mypaint_brush_set_mapping_n
void mypaint_brush_set_mapping_n(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int n)
Set the number of points in an input mapping for a brush setting.
MyPaintBrush::mypaint_brush_stroke_to_2
int mypaint_brush_stroke_to_2(MyPaintBrush *self, MyPaintSurface2 *surface, float x, float y, float pressure, float xtilt, float ytilt, double dtime, float viewzoom, float viewrotation, float barrel_rotation)
Use the brush to draw a stroke segment on a MyPaintSurface2.
MyPaintBrushInput
MyPaintBrushInput
Definition: mypaint-brush-settings-gen.h:5
MyPaintBrush::mypaint_brush_new_stroke
void mypaint_brush_new_stroke(MyPaintBrush *self)
Start a new stroke.
MyPaintBrush::mypaint_brush_set_print_inputs
void mypaint_brush_set_print_inputs(MyPaintBrush *self, gboolean enabled)
Enable/Disable debug printouts.
mypaint-brush-settings.h
MyPaintSurface2
Extends MyPaintSurface with support for spectral ops and multiple bounding boxes.
Definition: mypaint-surface.h:321
MyPaintBrushSetting
MyPaintBrushSetting
Definition: mypaint-brush-settings-gen.h:27
MyPaintBrush::mypaint_brush_get_mapping_n
int mypaint_brush_get_mapping_n(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input)
Get the number of points in an input mapping for a brush setting.
MyPaintBrush::mypaint_brush_from_defaults
void mypaint_brush_from_defaults(MyPaintBrush *self)
Initialize a brush with default values for all settings.
MyPaintBrush::mypaint_brush_get_inputs_used_n
int mypaint_brush_get_inputs_used_n(MyPaintBrush *self, MyPaintBrushSetting id)
Get the number of input mappings for a brush setting.
MyPaintBrush::mypaint_brush_set_mapping_point
void mypaint_brush_set_mapping_point(MyPaintBrush *self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float x, float y)
Set the coordinates of a point in an input mapping for a brush setting.
MyPaintBrush::mypaint_brush_from_string
gboolean mypaint_brush_from_string(MyPaintBrush *self, const char *string)
Initialize a brush from a JSON string.
G_END_DECLS
#define G_END_DECLS
Definition: mypaint-glib-compat.h:14
G_BEGIN_DECLS
#define G_BEGIN_DECLS
Definition: mypaint-glib-compat.h:13
MyPaintBrush::mypaint_brush_unref
void mypaint_brush_unref(MyPaintBrush *self)
Decrease the reference count by one, destroying the brush if it reaches 0.
MyPaintBrush::mypaint_brush_new_with_buckets
MyPaintBrush * mypaint_brush_new_with_buckets(int num_smudge_buckets)
Create a new brush with smudge buckets enabled.
MyPaintBrushState
MyPaintBrushState
Definition: mypaint-brush-settings-gen.h:95
MyPaintBrush::mypaint_brush_stroke_to_2_linearsRGB
int mypaint_brush_stroke_to_2_linearsRGB(MyPaintBrush *self, MyPaintSurface2 *surface, float x, float y, float pressure, float xtilt, float ytilt, double dtime, float viewzoom, float viewrotation, float barrel_rotation)
Same as mypaint_brush_stroke_to_2, but using linear sRGB for color dynamics.
MyPaintBrush::mypaint_brush_new
MyPaintBrush * mypaint_brush_new(void)
Create a new brush.