1 #ifndef __lib_gdi_region_h
2 #define __lib_gdi_region_h
4 #include <lib/base/object.h>
11 std::vector<eRect>::const_iterator r,
12 std::vector<eRect>::const_iterator &rBandEnd,
13 std::vector<eRect>::const_iterator rEnd,
18 while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1))
22 inline void AppendRegions(
23 std::vector<eRect>::const_iterator r,
24 std::vector<eRect>::const_iterator rEnd)
26 rects.insert(rects.end(), r, rEnd);
29 int do_coalesce(int prevStart, unsigned int curStart);
30 inline void coalesce(int &prevBand, unsigned int curBand)
32 if (curBand - prevBand == rects.size() - curBand) {
33 prevBand = do_coalesce(prevBand, curBand);
38 void appendNonO(std::vector<eRect>::const_iterator r,
39 std::vector<eRect>::const_iterator rEnd, int y1, int y2);
42 std::vector<eRect>::const_iterator r1,
43 std::vector<eRect>::const_iterator r1End,
44 std::vector<eRect>::const_iterator r2,
45 std::vector<eRect>::const_iterator r2End,
49 std::vector<eRect>::const_iterator r1,
50 std::vector<eRect>::const_iterator r1End,
51 std::vector<eRect>::const_iterator r2,
52 std::vector<eRect>::const_iterator r2End,
56 std::vector<eRect>::const_iterator r1,
57 std::vector<eRect>::const_iterator r1End,
58 std::vector<eRect>::const_iterator r2,
59 std::vector<eRect>::const_iterator r2End,
62 void regionOp(const gRegion ®1, const gRegion ®2, int opcode, int &overlap);
64 std::vector<eRect> rects;
69 // note: bit 0 and bit 1 have special meanings
75 gRegion(const eRect &rect);
79 gRegion operator&(const gRegion &r2) const;
80 gRegion operator-(const gRegion &r2) const;
81 gRegion operator|(const gRegion &r2) const;
82 gRegion &operator&=(const gRegion &r2);
83 gRegion &operator-=(const gRegion &r2);
84 gRegion &operator|=(const gRegion &r2);
86 void intersect(const gRegion &r1, const gRegion &r2);
87 void subtract(const gRegion &r1, const gRegion &r2);
88 void merge(const gRegion &r1, const gRegion &r2);
90 void moveBy(ePoint offset);