Mercurial > MadButterfly
annotate include/mb_paint.h @ 784:37a1bd3e3ce1
mbapp accept arguments for display, width and height
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 31 Aug 2010 00:06:11 +0800 |
parents | e813ac222f48 |
children | 586e50f82c1f |
rev | line source |
---|---|
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
1 #ifndef __PAINT_H_ |
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
2 #define __PAINT_H_ |
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
3 |
448
16116d84bc5e
Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents:
408
diff
changeset
|
4 #include "mb_graph_engine.h" |
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 #include "mb_types.h" |
186
530bb7728546
Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents:
185
diff
changeset
|
6 #include "mb_redraw_man.h" |
408
7f7855df2af0
Make unittest built by automake and autoconf.
Thinker K.F. Li <thinker@branda.to>
parents:
356
diff
changeset
|
7 #include "mb_img_ldr.h" |
186
530bb7728546
Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents:
185
diff
changeset
|
8 #include "mb_tools.h" |
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
10 extern paint_t *rdman_paint_color_new(redraw_man_t *rdman, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
11 co_comp_t r, co_comp_t g, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
12 co_comp_t b, co_comp_t a); |
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
13 extern void paint_color_set(paint_t *paint, |
21 | 14 co_comp_t r, co_comp_t g, |
15 co_comp_t b, co_comp_t a); | |
52
59a295651480
Add action mb_chgcolor_t to change color of paints.
Thinker K.F. Li <thinker@branda.to>
parents:
23
diff
changeset
|
16 extern void paint_color_get(paint_t *paint, |
59a295651480
Add action mb_chgcolor_t to change color of paints.
Thinker K.F. Li <thinker@branda.to>
parents:
23
diff
changeset
|
17 co_comp_t *r, co_comp_t *g, |
59a295651480
Add action mb_chgcolor_t to change color of paints.
Thinker K.F. Li <thinker@branda.to>
parents:
23
diff
changeset
|
18 co_comp_t *b, co_comp_t *a); |
356
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
19 #define paint_init(_paint, _type, _prepare, _free) \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
20 do { \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
21 (_paint)->pnt_type = _type; \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
22 (_paint)->flags = 0; \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
23 (_paint)->prepare = _prepare; \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
24 (_paint)->free = _free; \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
25 STAILQ_INIT((_paint)->members); \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
26 (_paint)->pnt_next = NULL; \ |
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
27 } while(0) |
260
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
28 #define paint_destroy(_paint) |
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
29 |
23
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
30 |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
31 extern paint_t *rdman_paint_linear_new(redraw_man_t *rdman, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
32 co_aix x1, co_aix y1, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
33 co_aix x2, co_aix y2); |
23
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
34 extern grad_stop_t *paint_linear_stops(paint_t *paint, |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
35 int n_stops, |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
36 grad_stop_t *stops); |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
37 extern paint_t *rdman_paint_radial_new(redraw_man_t *rdman, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
56
diff
changeset
|
38 co_aix cx, co_aix cy, co_aix r); |
55 | 39 extern grad_stop_t *paint_radial_stops(paint_t *paint, |
40 int n_stops, | |
41 grad_stop_t *stops); | |
42 | |
23
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
43 #define grad_stop_init(stop, _offset, _r, _g, _b, _a) \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
44 do { \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
45 (stop)->offset = _offset; \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
46 (stop)->r = _r; \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
47 (stop)->g = _g; \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
48 (stop)->b = _b; \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
49 (stop)->a = _a; \ |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
50 } while(0) |
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
51 |
260
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
52 /*! \brief A paint that fill or stroke shape with an image. |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
53 */ |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
54 extern paint_t *rdman_paint_image_new(redraw_man_t *rdman, |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
55 mb_img_data_t *img); |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
56 /*! \brief Set a matrix to transform image. |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
57 */ |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
186
diff
changeset
|
58 extern void paint_image_set_matrix(paint_t *paint, co_aix matrix[6]); |
356
3e84458968ec
Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
59 extern void paint_image_get_size(paint_t *paint, int *w, int *h); |
23
56f592f56ff7
Fix bug and add linear gradient paint.
Thinker K.F. Li <thinker@branda.to>
parents:
21
diff
changeset
|
60 |
18
0f3baa488a62
Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
61 #endif /* __PAINT_H_ */ |