region.h 530 B

12345678910111213141516171819202122232425262728
  1. #ifndef REGION_H
  2. #define REGION_H
  3. typedef struct Region Region;
  4. typedef struct RegData RegData;
  5. struct RegData {
  6. int size; /* # of rects it can hold */
  7. int nrects; /* # used */
  8. Rectangle * rects;
  9. };
  10. struct Region {
  11. Rectangle extents; /* the bounding box */
  12. RegData;
  13. };
  14. #define REGION_EMPTY(reg) ((reg)->nrects == 0)
  15. extern void region_init(Region *);
  16. extern void region_union(Region *, Rectangle, Rectangle);
  17. extern void region_reset(Region *);
  18. extern void region_copy(Region *, Region *);
  19. #endif /* !REGION_H */