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
|
.TH RTGRPBLIB_FILL_SHAPES 3 LIBRIFUNKTIONSTECKENSNITTSGLYFRASTERISERINGSPROGRAMBIBLIOTEKET
.SH NAME
rtgrpblib_fill_shapes - Generate image from applied drawing of filled shapes
.SH DESCRIPTION
.LP
.nf
#include <librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h>
void rtgrpblib_fill_shapes(double *image, size_t rowsize, const RTGRPBLIB_RASTER *\fIraster\fP);
.fi
.PP
Link with
.IR "-lrifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket -lm" .
.SH DESCRIPTION
The
.BR rtgrpblib_fill_shapes ()
function creates an user-usable image from a drawing.
After drawing each shapes component curves, to
.IR raster ,
this function creates an image of these shapes filled in,
and stores the image in the
.I image
buffer.
.PP
All drawn shapes must be closed. When shapes overlap,
the subtract from each other if the are drawn in opposite
angular direction, and add to each other if the are drawn
in angular direction.
.PP
.I image
shall be a row-major ordered buffer of single-element cells
that is at least as wide as
.I raster
and at least as tall as
.IR raster .
The actual width shall be specified in the
.I rowsize
parameter, however the function will only use area
specified by the size of
.IR raster ,
meaning that is, for example,
.I raster
is 10 cells wide, but
.I rowsize
is 15, only the 10 first columns in
.I image
will be written to, and the 5 last columns
will remain untouched.
.SH RETURN VALUES
None.
.SH ERRORS
None.
.SH APPLICATION USAGE
As librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket
is a font rasterisation library it is not designed to deal
with overlapping shapes other than removing a shape from
inside another shape (e.g. making the hole in the O). For the
best result in other cases, it is recommended to create a
union shape of overlapping shapes rather than drawing them
independently (this should not be necessarily for rastersing
text).
.SH NOTES
Row-major order means that each row is contiguously index,
if a row-major ordered buffer is
.I w
cells wide, the point
.RI ( x ,
.IR y )
has the index
.IR (y*w+x) .
.SH SEE ALSO
.BR librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket (7),
.BR rtgrpblib_create_raster (3),
.BR rtgrpblib_reset_raster (3),
.BR rtgrpblib_draw_linear_bezier (3),
.BR rtgrpblib_draw_quadratic_bezier (3),
.BR rtgrpblib_draw_cubic_bezier (3),
.BR rtgrpblib_draw_circular_arc (3)
|