1TICKIT_RECT_SUBTRACT(3) Library Functions Manual TICKIT_RECT_SUBTRACT(3)
2
3
4
6 tickit_rect_subtract - obtain the difference of two rectangles
7
9 #include <tickit.h>
10
11 int tickit_rect_subtract(TickitRect dst[4],
12 const TickitRect *orig, const TickitRect *hole);
13
14 Link with -ltickit.
15
17 tickit_rect_subtract() initialises the rectangle structures given by
18 dst (which must be an array capable of containing at least four rectan‐
19 gle structures) with a set of non-overlapping rectangles covering the
20 same area as that given by orig without covering hole. Depending on the
21 geometry of the given rectangles it will create from zero to four
22 resultant rectangles. It returns the number of rectangular regions ini‐
23 tialised into the result array.
24
25 If hole completely covers orig then the result will contain no rectan‐
26 gles. If they do not intersect then just orig will be returned. Other‐
27 wise, the result will contain non-overlapping horizontal stripes of
28 orig without hole.
29
31 tickit_rect_subtract() returns the number of rectangles written to dst.
32
34 tickit_rect_init_sized(3), tickit_rect_init_bounded(3),
35 tickit_rect_intersect(3), tickit_rect_add(3), tickit_rect(7), tickit(7)
36
37
38
39 TICKIT_RECT_SUBTRACT(3)