tickit_rect_subtract(3)

tickit_rect_subtract3

Obtain the difference of two rectangles

Usage

#include <tickit.h>

int tickit_rect_subtract(TickitRect dst[4],
    const TickitRect *orig, const TickitRect *hole);

Link with -ltickit.

Overview

tickit_rect_subtract() initialises the rectangle structures given by dst (which must be an array capable of containing at least four rectangle structures) with a set of non-overlapping rectangles covering the same area as that given by orig without covering hole. Depending on the geometry of the given rectangles it will create from zero to four resultant rectangles. It returns the number of rectangular regions initialised into the result array.

If hole completely covers orig then the result will contain no rectangles. If they do not intersect then just orig will be returned. Otherwise, the result will contain non-overlapping horizontal stripes of orig without hole.

Return value

tickit_rect_subtract() returns the number of rectangles written to dst.

Releases

Unchanged in 4 releases since Debian 10 (Buster).

  1. 10–13

From libtickit-dev 0.4.3-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.