GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A bounding box implementation. More...
Go to the source code of this file.
Data Structures | |
struct | gp_bbox |
A bounding box. More... | |
Macros | |
#define | GP_BBOX_FMT "[%i, %i] w=%u h=%u" |
A bounding box printf format string. | |
#define | GP_BBOX_PARS(bbox) (bbox).x, (bbox).y, (bbox).w, (bbox).h |
A bounding box printf parameters. | |
Typedefs | |
typedef struct gp_bbox | gp_bbox |
A bounding box. | |
Functions | |
static int | gp_bbox_empty (gp_bbox box) |
Returns true if bounding box is empty. | |
static gp_bbox | gp_bbox_pack (gp_coord x, gp_coord y, gp_coord w, gp_coord h) |
Creates a bounding box from coordinates and size. | |
static gp_bbox | gp_bbox_merge (gp_bbox box1, gp_bbox box2) |
Merges two bounding boxes. | |
static gp_bbox | gp_bbox_intersection (gp_bbox box1, gp_bbox box2) |
Calculates a bounding box intersection. | |
static int | gp_bbox_intersects (gp_bbox box1, gp_bbox box2) |
Returns true if bouding boxes intersects. | |
static gp_bbox | gp_bbox_move (gp_bbox box, gp_coord x, gp_coord y) |
Moves bounding box. | |
A bounding box implementation.
Definition in file gp_bbox.h.
|
inlinestatic |
Returns true if bounding box is empty.
Definition at line 39 of file gp_bbox.h.
References gp_bbox::h, and gp_bbox::w.
Referenced by gp_widget_ops_blit().
Calculates a bounding box intersection.
box1 | First bounding box. |
box2 | Second bounding box. |
Definition at line 94 of file gp_bbox.h.
References GP_MAX, GP_MIN, gp_bbox::h, gp_bbox::w, gp_bbox::x, and gp_bbox::y.
Returns true if bouding boxes intersects.
box1 | First bounding box. |
box2 | Second bounding box. |
Definition at line 114 of file gp_bbox.h.
References gp_bbox::h, gp_bbox::w, gp_bbox::x, and gp_bbox::y.
Merges two bounding boxes.
box1 | First bounding box. |
box2 | Second bounding box. |
Definition at line 74 of file gp_bbox.h.
References GP_MAX, GP_MIN, gp_bbox::h, gp_bbox::w, gp_bbox::x, and gp_bbox::y.
Referenced by gp_widget_ops_blit().
Moves bounding box.
box | A bounding box. |
x | An offset to move by in horizontal direction. |
y | An offset to move by in vertical direction. |
Definition at line 140 of file gp_bbox.h.
References gp_bbox_pack(), gp_bbox::h, gp_bbox::w, gp_bbox::x, and gp_bbox::y.
Creates a bounding box from coordinates and size.
x | A bounding box left x coordinate. |
y | A bounding box top y coordinate. |
w | A bounding box width. |
h | A bounding box height. |
Definition at line 54 of file gp_bbox.h.
References gp_bbox::x.
Referenced by gp_bbox_move(), and gp_widget_ops_blit().