26static int _cmpX(
const void *
av,
const void *
bv);
28static int _cmpY(
const void *
av,
const void *
bv);
231 return (
a->y >
b->y) - (
a->y <
b->y);
265 return (
a->x >
b->x) - (
a->x <
b->x);
301 for(
int i = 0; i <
copy->len - 1; i++) {
302 for(
int j = i + 1;
j <
copy->len;
j++) {
334 for(
int i = 0; i <
copy->len - 1; i++) {
335 for(
int j = i + 1;
j <
copy->len;
j++) {
363 for(
int i = 0; i <
self->len; i++) {
382 for(
int i = 0 ; i <
self->len ; i++) {
383 if(func(&(
self->areas[i]),
data) ==
true) {
400 for(
int i = 0; i <
self->len; i++) {
430 for(
int i = 0 ; i <
self->len ; i++) {
432 if(i == 0 || area->
x <
x) {
436 if(i == 0 || area->
y <
y) {
465 for(
int i = 0; i <
self->len; i++) {
568 for(
int i = 0 ; i <
self->len ; i++) {
RArea RAreaInvalid(void)
Return a facially-invalid RArea.
RArea RAreaNew(int x, int y, int width, int height)
Construct an RArea from given components.
RArea RAreaIntersect(const RArea *self, const RArea *other)
Return an RArea describing the intersection of two RArea's.
int RAreaArea(const RArea *self)
Return the area of an RArea.
RAreaList * RAreaHorizontalUnion(const RArea *self, const RArea *other)
Create a list of maximal horizontal stripes of two RArea's.
bool RAreaIsIntersect(const RArea *self, const RArea *other)
Do two areas intersect?
bool RAreaIsValid(const RArea *self)
Is an RArea facially valid?
void RAreaPrint(const RArea *self)
Pretty-print an RArea.
int RAreaY2(const RArea *self)
Return the bottom edge of an RArea.
int RAreaX2(const RArea *self)
Return the right edge of an RArea.
RAreaList * RAreaVerticalUnion(const RArea *self, const RArea *other)
Create a list of maximal vertical stripes of two RArea's.
RAreaList * RAreaListNew(int cap,...)
Create an RAreaList from a set of RArea's.
RArea RAreaListBestTarget(const RAreaList *self, const RArea *area)
Find the RArea in an RAreaList that has the largest intersection with a given RArea.
static int _cmpX(const void *av, const void *bv)
qsort comparison function to sort by RArea.x
int RAreaListMinY2(const RAreaList *self)
Find the y coordinate of the bottom edge of the top-most RArea in an RAreaList.
static void RAreaListSortY(const RAreaList *self)
Sort the RArea's in an RAreaList by their y coordinate.
static RAreaList * RAreaListIntersectCrop(const RAreaList *self, const RArea *area)
Create an RAreaList from another, cropped to a certain area defined by an RArea.
static void RAreaListAddList(RAreaList *self, const RAreaList *other)
Add the RArea's from one RAreaList onto another.
RAreaList * RAreaListVerticalUnion(const RAreaList *self)
Create an RAreaList whose RArea's are the vertical union of our RArea's.
void RAreaListFree(RAreaList *self)
Clean up and free an RAreaList.
RArea RAreaListBigArea(const RAreaList *self)
Create a maximal RArea describing the union of an RAreaList.
int RAreaListMaxY(const RAreaList *self)
Find the y coordinate of the bottom-most RArea in an RAreaList.
void RAreaListPrint(const RAreaList *self)
Pretty-print an RAreaList.
static int _cmpY(const void *av, const void *bv)
qsort comparison function to sort by RArea.t
RAreaList * RAreaListIntersect(const RAreaList *self, const RArea *area)
Create an RAreaList of all the areas in an RAreaList that a given RArea intersects with.
static void RAreaListDelete(RAreaList *self, int index)
Delete an RArea from inside an RAreaList.
int RAreaListMaxX(const RAreaList *self)
Find the x coordinate of the right-most RArea in an RAreaList.
static RAreaList * RAreaListCopy(const RAreaList *self)
Create a copy of a given RAreaList.
RAreaList * RAreaListHorizontalUnion(const RAreaList *self)
Create an RAreaList whose RArea's are the horizontal union of our RArea's.
void RAreaListForeach(const RAreaList *self, bool(*func)(const RArea *cur_area, void *data), void *data)
Run a function over each RArea in an RAreaList until one returns true, allowing them a place to stash...
static void RAreaListSortX(const RAreaList *self)
Sort the RArea's in an RAreaList by their x coordinate.
RAreaList * RAreaListCopyCropped(const RAreaList *self, int left_margin, int right_margin, int top_margin, int bottom_margin)
Create a copy of an RAreaList with given amounts cropped off the sides.
void RAreaListAdd(RAreaList *self, const RArea *area)
Add an RArea onto an RAreaList.
int RAreaListMinX2(const RAreaList *self)
Find the x coordinate of the right edge of the left-most RArea in an RAreaList.
A particular extent of space.