1 #ifndef __lib_gdi_region_h
2 #define __lib_gdi_region_h
4 #include <lib/base/object.h>
7 class gRegion: public virtual iObject
12 std::vector<eRect>::const_iterator r,
13 std::vector<eRect>::const_iterator &rBandEnd,
14 std::vector<eRect>::const_iterator rEnd,
19 while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1))
23 inline void AppendRegions(
24 std::vector<eRect>::const_iterator r,
25 std::vector<eRect>::const_iterator rEnd)
27 rects.insert(rects.end(), r, rEnd);
30 int do_coalesce(int prevStart, unsigned int curStart);
31 inline void coalesce(int &prevBand, unsigned int curBand)
33 if (curBand - prevBand == rects.size() - curBand) {
34 prevBand = do_coalesce(prevBand, curBand);
39 void appendNonO(std::vector<eRect>::const_iterator r,
40 std::vector<eRect>::const_iterator rEnd, int y1, int y2);
43 std::vector<eRect>::const_iterator r1,
44 std::vector<eRect>::const_iterator r1End,
45 std::vector<eRect>::const_iterator r2,
46 std::vector<eRect>::const_iterator r2End,
50 std::vector<eRect>::const_iterator r1,
51 std::vector<eRect>::const_iterator r1End,
52 std::vector<eRect>::const_iterator r2,
53 std::vector<eRect>::const_iterator r2End,
57 std::vector<eRect>::const_iterator r1,
58 std::vector<eRect>::const_iterator r1End,
59 std::vector<eRect>::const_iterator r2,
60 std::vector<eRect>::const_iterator r2End,
63 void regionOp(const gRegion ®1, const gRegion ®2, int opcode, int &overlap);
65 std::vector<eRect> rects;
70 // note: bit 0 and bit 1 have special meanings
76 gRegion(const eRect &rect);
80 void intersect(const gRegion &r1, const gRegion &r2);
81 void subtract(const gRegion &r1, const gRegion &r2);
82 void merge(const gRegion &r1, const gRegion &r2);