## table of contents

other versions

- buster 0.2-5
- testing 0.3.5-1
- unstable 0.3.5-1
- experimental 0.4.0~rc4-1

TICKIT_RECT_ADD(3) | Library Functions Manual | TICKIT_RECT_ADD(3) |

# NAME¶

tickit_rect_add - obtain the union sum of two rectangles# SYNOPSIS¶

#include <tickit.h>int tickit_rect_add(TickitRectdst[3],const TickitRect *a, const TickitRect *b);

Link with *-ltickit*.

# DESCRIPTION¶

**tickit_rect_add**() initialises the rectangle structures given by

*dst*(which must be an array capable of containing at least three rectangle structures) with a set of non-overlapping rectangles covering the same area as the two given by

*a*and

*b*. Depending on the geometry of the given rectangles it may create one, two, or three resultant rectangles. It returns the number of rectangular regions initialised into the result array.

If the original rectangles do not touch then the result will contain just those two. If they touch then the result will contain the one to three non-overlapping horizontal stripes that cover the same area, in order of increasing line number.

# RETURN VALUE¶

**tickit_rect_add**() returns the number of rectangles written to

*dst*.