TICKIT_RECT_ADD(3)
β¨ TICKIT_RECT_ADD β¨ (that's the tickit_rect_add(3) page, Library Functions Manual bestie π)
okay so real talk, this one is a lil gem. it's called tickit_rect_add and its whole job is obtain the union sum of two rectangles. that's it. that's the gig. union sum. slay π
πΈ SYNOPSIS πΈ
#include <tickit.h>
int tickit_rect_add(TickitRect dst[3],
const TickitRect *a, const TickitRect *b);
and like, obviously you link with -ltickit π«Ά
π¦ DESCRIPTION π¦
so tickit_rect_add() takes the rectangle structs pointed at by a and b and fills up dst with a set of non-overlapping rectangles that cover the exact same area as those two originals. no cap, same area, just... reorganised.
heads up bestie: dst must be an array that can hold at least three rectangle structures. like, at minimum. don't be out here passing a tiny array, it's giving chaos π
depending on the geometry of the rectangles you handed over, this bad boy might produce one, two, or three resultant rectangles. iconic range honestly. and then it returns the number of rectangular regions it initialised into your result array, so you know exactly how many of those slots are real and how many are just vibes.
now the tea on what actually lands in dst:
- if the original rectangles do not touch, the result will contain just those two. easy. effortless. no notes.
- if they do touch, the result will contain the one to three non-overlapping horizontal stripes that cover the same area, and they come out in order of increasing line number β¨ like a lil ladder going down the screen.
that's the whole vibe check. union, but tidy. π
π₯ RETURN VALUE π₯
tickit_rect_add() returns the number of rectangles written to dst. that's your count, your receipt, your little "here's how many I actually gave you" π§Ύβ¨
π SEE ALSO π
tickit_rect_init_sized(3)tickit_rect_init_bounded(3)tickit_rect_intersect(3)tickit_rect_subtract(3)tickit_rect(7)tickit(7)
and that's the page!! this one comes to you straight from the Library Functions Manual, filed under TICKIT_RECT_ADD(3) β go forth and union those rectangles, bestie, you're gonna ate it πππ¦
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms