-
Notifications
You must be signed in to change notification settings - Fork 3
darnit_bbox.h
slaeshjag edited this page Mar 23, 2013
·
19 revisions
a DARNIT_BBOX is a statically allocated list of bounding boxes. These can quickly be matched against an area, with a list of bounding boxes overlapping that area being returned.
- DARNIT_BBOX *d_bbox_new( unsigned int size);
- DARNIT_BBOX *d_bbox_free(DARNIT_BBOX *bbox);
- int d_bbox_test(DARNIT_BBOX *bbox, int x, int y, unsigned int w, unsigned int h, unsigned int *list, unsigned int listlen);
- int d_bbox_add(DARNIT_BBOX *bbox, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
- void d_bbox_delete(DARNIT_BBOX *bbox, int key);
- void d_bbox_move(DARNIT_BBOX *bbox, int key, unsigned int x, unsigned int y);
- void d_bbox_resize(DARNIT_BBOX *bbox, int key, unsigned int w, unsigned int h);
- void d_bbox_clear(DARNIT_BBOX *bbox);
DARNIT_BBOX *d_bbox_new(unsigned int size);
Returns a list with space for size bounding boxes.
Arguments
- size - Number of bounding boxes to allocate space for
Return value
NULL on failure. Something else is a valid bounding box list.