From 62b4a3ededd237f4b4850d91c052585e2f687499 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 2 Jun 2024 21:46:07 +1000 Subject: Switched to luigi, parsing out FLAC metadata. --- rect.c | 96 ------------------------------------------------------------------ 1 file changed, 96 deletions(-) delete mode 100644 rect.c (limited to 'rect.c') diff --git a/rect.c b/rect.c deleted file mode 100644 index bcc95cd..0000000 --- a/rect.c +++ /dev/null @@ -1,96 +0,0 @@ -#include "maths.h" -#include "rect.h" - -Rectangle make_rect(int x, int y, int w, int h) { - Rectangle r; - r.x = x; - r.y = y; - r.w = w; - r.h = h; - return r; -} - -int rects_overlap(const Rectangle* a, const Rectangle* b) { - return - a->x + a->w > b->x && - a->y + a->h > b->y && - a->x < b->x + b->w && - a->y < b->y + b->h; -} - -int rects_overlap2( - int x0, - int y0, - int w0, - int h0, - int x1, - int y1, - int w1, - int h1 -) { - return - x0 + w0 > x1 && - y0 + h0 > y1 && - x0 < x1 + w1 && - y0 < y1 + h1; -} - -int point_rect_overlap( - const Rectangle* r, - int px, - int py -) { - return - px >= r->x && - py >= r->y && - px <= r->x + r->w && - py <= r->y + r->h; -} - -int point_rect_overlap2( - int x, - int y, - int w, - int h, - int px, - int py -) { - return - px > x && - py > y && - px < x + w && - py < y + h; -} - -Rectangle rect_intersect( - const Rectangle* a, - const Rectangle* b -) { - int x1, y1, x2, y2; - Rectangle r; - x1 = maxi(a->x, b->x); - y1 = maxi(a->y, b->y); - x2 = mini(a->x + a->w, b->x + b->w); - y2 = mini(a->y + a->h, b->y + b->h); - r.x = x1; - r.y = y1; - r.w = maxi(0, x2 - x1); - r.h = maxi(0, y2 - y1); - return r; -} - -Rectangle* rect_merge( - Rectangle* d, - const Rectangle* r -) { - int x1, y1, x2, y2; - x1 = mini(d->x, r->x); - y1 = mini(d->y, r->y); - x2 = maxi(d->x + d->w, r->x + r->w); - y2 = maxi(d->y + d->h, r->y + r->h); - d->x = x1; - d->y = y1; - d->w = x2 - x1; - d->h = y2 - y1; - return d; -} -- cgit v1.2.3-54-g00ecf