annotate src/paint.h @ 21:83d24300a992

opacity (alpha) channel
author Thinker K.F. Li <thinker@branda.to>
date Sat, 02 Aug 2008 16:06:53 +0800
parents cf6d65398619
children 56f592f56ff7
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
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 #include <cairo.h>
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 #include "mb_types.h"
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 #include "redraw_man.h"
19
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
7 #include "tools.h"
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 typedef float co_comp_t;
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 extern paint_t *paint_color_new(redraw_man_t *rdman,
21
83d24300a992 opacity (alpha) channel
Thinker K.F. Li <thinker@branda.to>
parents: 19
diff changeset
12 co_comp_t r, co_comp_t g,
83d24300a992 opacity (alpha) channel
Thinker K.F. Li <thinker@branda.to>
parents: 19
diff changeset
13 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
14 extern void paint_color_set(paint_t *paint,
21
83d24300a992 opacity (alpha) channel
Thinker K.F. Li <thinker@branda.to>
parents: 19
diff changeset
15 co_comp_t r, co_comp_t g,
83d24300a992 opacity (alpha) channel
Thinker K.F. Li <thinker@branda.to>
parents: 19
diff changeset
16 co_comp_t b, co_comp_t a);
19
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
17 #define paint_init(_paint, _prepare, _free) \
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
18 do { \
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
19 (_paint)->prepare = _prepare; \
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
20 (_paint)->free = _free; \
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
21 STAILQ_INIT((_paint)->members); \
cf6d65398619 More animation demo
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
22 } while(0) \
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 #endif /* __PAINT_H_ */