43 #define private public 64 : contenders(0), semaphore(0)
89 #define CONTAINSCHECK(r1, r2) \ 90 ((r2).left() >= (r1).left() && (r2).right() <= (r1).right() && \ 91 (r2).top() >= (r1).top() && (r2).bottom() <= (r1).bottom()) 97 enum { Single, Vector } mode;
110 if(mode != Vector && numRects) {
153 const QRect &r1 = innerRect;
160 if (area > innerArea) {
178 qt_nextRegionLock.
lock();
180 if(qt_nextRegionPtr) {
182 qt_nextRegionPtr = rv->
next;
186 for(
int ii = 0; ii < 256; ++ii) {
188 qt_nextRegionPtr[ii].
next = 0;
190 qt_nextRegionPtr[ii].
next = &qt_nextRegionPtr[ii + 1];
195 qt_nextRegionPtr = rv->
next;
198 qt_nextRegionLock.
unlock();
204 qt_nextRegionLock.
lock();
206 qt_nextRegionPtr = rp;
207 qt_nextRegionLock.
unlock();
230 rp->~QRegionPrivate();
237 return !preg || preg->
numRects == 0;
245 QRect *destRect = rects.data() + numRects;
251 const QRect *rFirst = srcRect;
252 QRect *myLast = rects.data() + (numRects - 1);
253 if (rFirst->
top() == myLast->
top()
255 && rFirst->
left() == (myLast->
right() + 1))
258 updateInnerRect(*myLast);
265 const int newNumRects = numRects + numAppend;
266 if (newNumRects > rects.size()) {
267 rects.resize(newNumRects);
268 destRect = rects.data() + numRects;
270 memcpy(destRect, srcRect, numAppend *
sizeof(
QRect));
273 if (innerArea < r->innerArea) {
286 numRects = newNumRects;
299 memmove(rects.data() + r->
numRects, rects.constData(),
300 numRects *
sizeof(
QRect));
306 if (innerArea < r->innerArea) {
315 qMin(destRect->top(), srcRect->top()),
316 qMax(destRect->right(), srcRect->right()),
317 qMax(destRect->bottom(), srcRect->bottom()));
319 numRects = newNumRects;
328 const QRect *myLast = (mode==Vector)?(rects.constData() + (numRects - 1)):&single;
331 if (rFirst->
top() > (myLast->
bottom() + 1)
332 || (rFirst->
top() == myLast->
top()
352 #if defined(Q_WS_X11) 356 #elif defined(Q_WS_MAC) 360 #elif defined(Q_WS_QWS) 366 register const QRect *r2,
const QRect *r2End,
register int y1,
register int y2);
368 register int y1,
register int y2);
376 #define RectangleOut 0 377 #define RectangleIn 1 378 #define RectanglePart 2 379 #define EvenOddRule 0 380 #define WindingRule 1 443 #define EXTENTCHECK(r1, r2) \ 444 ((r1)->right() >= (r2)->left() && \ 445 (r1)->left() <= (r2)->right() && \ 446 (r1)->bottom() >= (r2)->top() && \ 447 (r1)->top() <= (r2)->bottom()) 452 #define EXTENTS(r,idRect){\ 453 if((r)->left() < (idRect)->extents.left())\ 454 (idRect)->extents.setLeft((r)->left());\ 455 if((r)->top() < (idRect)->extents.top())\ 456 (idRect)->extents.setTop((r)->top());\ 457 if((r)->right() > (idRect)->extents.right())\ 458 (idRect)->extents.setRight((r)->right());\ 459 if((r)->bottom() > (idRect)->extents.bottom())\ 460 (idRect)->extents.setBottom((r)->bottom());\ 466 #define MEMCHECK(dest, rect, firstrect){\ 467 if ((dest).numRects >= ((dest).rects.size()-1)){\ 468 firstrect.resize(firstrect.size() * 2); \ 469 (rect) = (firstrect).data() + (dest).numRects;\ 478 #define NUMPTSTOBUFFER 200 604 register const QRect *pBox,
606 register QRect *pExtents;
632 while (pBox <= pBoxEnd) {
633 if (pBox->
left() < pExtents->
left())
651 register QRect *pbox;
685 register const QRect *r2,
const QRect *r2End,
int y1,
int y2)
689 register QRect *pNextRect;
693 while (r1 != r1End && r2 != r2End) {
751 register QRect *pPrevBox;
752 register QRect *pCurBox;
753 register QRect *pRegEnd;
761 pPrevBox = rData + prevStart;
762 prevNumRects = curStart - prevStart;
769 pCurBox = rData + curStart;
770 bandY1 = pCurBox->
top();
771 for (curNumRects = 0; pCurBox != pRegEnd && pCurBox->
top() == bandY1; ++curNumRects) {
775 if (pCurBox != pRegEnd) {
783 while ((pRegEnd - 1)->top() == pRegEnd->
top())
785 curStart = pRegEnd - rData;
789 if (curNumRects == prevNumRects && curNumRects != 0) {
790 pCurBox -= curNumRects;
795 if (pPrevBox->
bottom() == pCurBox->
top() - 1) {
810 }
while (prevNumRects != 0);
813 pCurBox -= curNumRects;
814 pPrevBox -= curNumRects;
827 }
while (curNumRects != 0);
839 if (pCurBox == pRegEnd) {
840 curStart = prevStart;
843 *pPrevBox++ = *pCurBox++;
845 }
while (pCurBox != pRegEnd);
882 register const QRect *r1;
883 register const QRect *r2;
890 register const QRect *r1BandEnd;
891 register const QRect *r2BandEnd;
961 while (r1BandEnd != r1End && r1BandEnd->
top() == r1->
top())
965 while (r2BandEnd != r2End && r2BandEnd->
top() == r2->
top())
976 if (r1->
top() < r2->
top()) {
977 top =
qMax(r1->
top(), ybot + 1);
980 if (nonOverlap1Func != 0 && bot >= top)
981 (*nonOverlap1Func)(dest, r1, r1BandEnd, top, bot);
983 }
else if (r2->
top() < r1->
top()) {
984 top =
qMax(r2->
top(), ybot + 1);
987 if (nonOverlap2Func != 0 && bot >= top)
988 (*nonOverlap2Func)(dest, r2, r2BandEnd, top, bot);
1001 prevBand =
miCoalesce(dest, prevBand, curBand);
1010 (*overlapFunc)(dest, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot);
1012 if (dest.numRects != curBand)
1013 prevBand =
miCoalesce(dest, prevBand, curBand);
1019 if (r1->bottom() == ybot)
1021 if (r2->bottom() == ybot)
1023 }
while (r1 != r1End && r2 != r2End);
1030 if (nonOverlap1Func != 0) {
1033 while (r1BandEnd < r1End && r1BandEnd->top() == r1->
top())
1035 (*nonOverlap1Func)(dest, r1, r1BandEnd,
qMax(r1->top(), ybot + 1), r1->bottom());
1037 }
while (r1 != r1End);
1039 }
else if ((r2 != r2End) && (nonOverlap2Func != 0)) {
1042 while (r2BandEnd < r2End && r2BandEnd->top() == r2->
top())
1044 (*nonOverlap2Func)(dest, r2, r2BandEnd,
qMax(r2->top(), ybot + 1), r2->bottom());
1046 }
while (r2 != r2End);
1086 register int y1,
register int y2)
1088 register QRect *pNextRect;
1122 register const QRect *r2,
const QRect *r2End,
register int y1,
register int y2)
1124 register QRect *pNextRect;
1128 #define MERGERECT(r) \ 1129 if ((dest.numRects != 0) && \ 1130 (pNextRect[-1].top() == y1) && \ 1131 (pNextRect[-1].bottom() == y2) && \ 1132 (pNextRect[-1].right() >= r->left()-1)) { \ 1133 if (pNextRect[-1].right() < r->right()) { \ 1134 pNextRect[-1].setRight(r->right()); \ 1135 dest.updateInnerRect(pNextRect[-1]); \ 1136 Q_ASSERT(pNextRect[-1].left() <= pNextRect[-1].right()); \ 1139 MEMCHECK(dest, pNextRect, dest.rects) \ 1140 pNextRect->setCoords(r->left(), y1, r->right(), y2); \ 1141 dest.updateInnerRect(*pNextRect); \ 1148 while (r1 != r1End && r2 != r2End) {
1159 }
while (r1 != r1End);
1161 while (r2 != r2End) {
1211 const QRect *rEnd,
register int y1,
register int y2)
1213 register QRect *pNextRect;
1245 register const QRect *r2,
const QRect *r2End,
register int y1,
register int y2)
1247 register QRect *pNextRect;
1255 while (r1 != r1End && r2 != r2End) {
1256 if (r2->
right() < x1) {
1261 }
else if (r2->
left() <= x1) {
1265 x1 = r2->
right() + 1;
1266 if (x1 > r1->
right()) {
1289 x1 = r2->
right() + 1;
1290 if (x1 > r1->
right()) {
1305 if (r1->
right() >= x1) {
1320 while (r1 != r1End) {
1413 for (
int i = 0; i < r1->
numRects; ++i, ++rr1, ++rr2) {
1434 for (i = 0; i < pRegion->
numRects; ++i) {
1443 register const QRect *pbox;
1444 register const QRect *pboxEnd;
1445 QRect rect(rx, ry, rwidth, rheight);
1446 register QRect *prect = ▭
1447 int partIn, partOut;
1457 pbox < pboxEnd; ++pbox) {
1461 if (pbox->
top() > ry) {
1463 if (partIn || pbox->
top() > prect->
bottom())
1468 if (pbox->
right() < rx)
1471 if (pbox->
left() > rx) {
1485 if (ry > prect->
bottom())
1587 #define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \ 1596 dx = (x2) - xStart; \ 1600 incr1 = -2 * dx + 2 * (dy) * m1; \ 1601 incr2 = -2 * dx + 2 * (dy) * m; \ 1602 d = 2 * m * (dy) - 2 * dx - 2 * (dy); \ 1606 incr1 = 2 * dx - 2 * (dy) * m1; \ 1607 incr2 = 2 * dx - 2 * (dy) * m; \ 1608 d = -2 * m * (dy) + 2 * dx; \ 1613 #define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \ 1651 #define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \ 1652 BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \ 1653 bres.m, bres.m1, bres.incr1, bres.incr2) 1655 #define BRESINCRPGONSTRUCT(bres) \ 1656 BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2) 1710 #define COUNTERCLOCKWISE -1 1741 #define SLLSPERBLOCK 25 1763 #define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \ 1764 if (pAET->ymax == y) { \ 1765 pPrevAET->next = pAET->next; \ 1766 pAET = pPrevAET->next; \ 1769 pAET->back = pPrevAET; \ 1772 BRESINCRPGONSTRUCT(pAET->bres) \ 1774 pAET = pAET->next; \ 1786 #define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \ 1787 if (pAET->ymax == y) { \ 1788 pPrevAET->next = pAET->next; \ 1789 pAET = pPrevAET->next; \ 1791 pAET->back = pPrevAET; \ 1794 BRESINCRPGONSTRUCT(pAET->bres) \ 1796 pAET = pAET->next; \ 1851 #define LARGE_COORDINATE 1000000 1852 #define SMALL_COORDINATE -LARGE_COORDINATE 1874 pSLL = pPrevSLL->
next;
1875 while (pSLL && (pSLL->
scanline < scanline)) {
1883 if ((!pSLL) || (pSLL->
scanline > scanline)) {
1888 (*SLLBlock)->
next = tmpSLLBlock;
1890 *SLLBlock = tmpSLLBlock;
1893 pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
1897 pPrevSLL->
next = pSLL;
1908 start = start->
next;
1947 register const QPoint *top,
1971 pSLLBlock->
next = 0;
1973 PrevPt = &pts[count - 1];
1986 if (PrevPt->
y() > CurrPt->
y()) {
1999 if (bottom->
y() != top->
y()) {
2000 pETEs->
ymax = bottom->
y() - 1;
2005 dy = bottom->
y() - top->
y();
2010 if (PrevPt->
y() > ET->
ymax)
2011 ET->
ymax = PrevPt->
y();
2012 if (PrevPt->
y() < ET->
ymin)
2013 ET->
ymin = PrevPt->
y();
2046 ETEs->
back = pPrevAET;
2047 pPrevAET->
next = ETEs;
2077 register int inside = 1;
2078 register int isInside = 0;
2089 if (!inside && !isInside || inside && isInside) {
2113 register int changed = 0;
2120 pETEchase = pETEchase->
back;
2123 if (pETEchase != pETEinsert) {
2124 pETEchaseBackTMP = pETEchase->
back;
2128 pETEinsert->
next = pETEchase;
2129 pETEchase->
back->
next = pETEinsert;
2130 pETEchase->
back = pETEinsert;
2131 pETEinsert->
back = pETEchaseBackTMP;
2146 tmpSLLBlock = pSLLBlock->
next;
2148 pSLLBlock = tmpSLLBlock;
2160 static void PtsToRegion(
register int numFullPtBlocks,
register int iCurPtBlock,
2163 register QRect *rects;
2167 register QRect *extents;
2168 register int numRects;
2171 numRects = ((numFullPtBlocks *
NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
2175 CurPtBlock = FirstPtBlock;
2182 for (; numFullPtBlocks >= 0; --numFullPtBlocks) {
2185 if (!numFullPtBlocks)
2186 i = iCurPtBlock >> 1;
2188 for (pts = CurPtBlock->
pts; i--; pts += 2) {
2189 if (pts->
x() == pts[1].
x())
2191 if (numRects && pts->
x() == rects->
left() && pts->
y() == rects->
bottom() + 1
2192 && pts[1].
x() == rects->
right()+1 && (numRects == 1 || rects[-1].
top() != rects->
top())
2193 && (i && pts[2].y() > pts[1].
y())) {
2200 rects->
setCoords(pts->
x(), pts->
y(), pts[1].
x() - 1, pts[1].
y());
2201 if (rects->
left() < extents->
left())
2208 CurPtBlock = CurPtBlock->
next;
2235 register int iPts = 0;
2244 int fixWAET =
false;
2247 int numFullPtBlocks = 0;
2252 if (((Count == 4) ||
2253 ((Count == 5) && (Pts[4].x() == Pts[0].x()) && (Pts[4].y() == Pts[0].y())))
2254 && (((Pts[0].y() == Pts[1].y()) && (Pts[1].x() == Pts[2].x()) && (Pts[2].y() == Pts[3].y())
2255 && (Pts[3].x() == Pts[0].x())) || ((Pts[0].x() == Pts[1].x())
2256 && (Pts[1].y() == Pts[2].y()) && (Pts[2].x() == Pts[3].x())
2257 && (Pts[3].y() == Pts[0].y())))) {
2258 int x =
qMin(Pts[0].x(), Pts[2].x());
2260 int y =
qMin(Pts[0].y(), Pts[2].y());
2275 if (!(pETEs = static_cast<EdgeTableEntry *>(malloc(
sizeof(
EdgeTableEntry) * Count))))
2278 pts = FirstPtBlock.
pts;
2281 curPtBlock = &FirstPtBlock;
2287 for (y = ET.
ymin; y < ET.
ymax; ++y) {
2313 curPtBlock->
next = tmpPtBlock;
2314 curPtBlock = tmpPtBlock;
2315 pts = curPtBlock->
pts;
2327 for (y = ET.
ymin; y < ET.
ymax; ++y) {
2349 if (pWETE == pAET) {
2360 curPtBlock->
next = tmpPtBlock;
2361 curPtBlock = tmpPtBlock;
2362 pts = curPtBlock->
pts;
2382 PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
2383 for (curPtBlock = FirstPtBlock.
next; --numFullPtBlocks >= 0;) {
2384 tmpPtBlock = curPtBlock->
next;
2386 curPtBlock = tmpPtBlock;
2403 xr.setCoords(prev1, y, x-1, y); \ 2404 UnionRectWithRegion(&xr, region, *region); \ 2412 for (y = 0; y < image.
height(); ++y) {
2414 int w = image.
width();
2417 for (x = 0; x < w;) {
2418 uchar byte = line[x / 8];
2419 if (x > w - 8 || byte!=all) {
2421 for (
int b = 8; b > 0 && x < w; --b) {
2422 if (!(byte & 0x01) == !all) {
2438 for (
int b = 8; b > 0 && x < w; --b) {
2439 if (!(byte & 0x80) == !all) {
2501 }
else if (t == Ellipse) {
2511 #if defined(Q_WS_X11) 2514 #elif defined(Q_WS_MAC) 2535 if (a.
count() > 2) {
2543 #if defined(Q_WS_X11) 2546 #elif defined(Q_WS_MAC) 2591 #if defined(Q_WS_X11) 2594 #elif defined(Q_WS_MAC) 2604 #if defined(Q_WS_X11) 2606 XDestroyRegion(x->
rgn);
2608 free(x->xrectangles);
2609 #elif defined(Q_WS_MAC) 2627 if (!
d->ref.deref())
2639 if (!
d->ref.deref())
2663 #if defined(Q_WS_X11) 2666 #elif defined(Q_WS_MAC) 2686 return d == &shared_empty ||
d->qt_rgn->numRects == 0;
2712 return d->qt_rgn->single.contains(r);
2731 #if defined(Q_WS_X11) 2732 if (
d->xrectangles) {
2733 free(
d->xrectangles);
2736 #elif defined(Q_WS_MAC) 2771 if (
d->qt_rgn->contains(*r.
d->
qt_rgn)) {
2775 }
else if (
d->qt_rgn->canAppend(r.
d->
qt_rgn)) {
2802 if (
d->qt_rgn->contains(*r.
d->
qt_rgn)) {
2806 }
else if (
d->qt_rgn->canAppend(r.
d->
qt_rgn)) {
2810 }
else if (
d->qt_rgn->canPrepend(r.
d->
qt_rgn)) {
2818 return *
this = unite(r);
2850 if (
d->qt_rgn->contains(*r.
d->
qt_rgn))
2856 #ifdef QT_GREENPHONE_OPT 2878 #ifdef QT_GREENPHONE_OPT 2897 return QRegion(
d->qt_rgn->single & r);
2923 return intersect(r);
2940 QRect result =
d->qt_rgn->single & r;
2941 d->qt_rgn->single = result;
2942 d->qt_rgn->extents = result;
2943 d->qt_rgn->innerRect = result;
2944 d->qt_rgn->innerArea = result.
height() * result.
width();
2946 d->qt_rgn->extents &= r;
2947 d->qt_rgn->innerRect &= r;
2948 d->qt_rgn->innerArea =
d->qt_rgn->innerRect.height() *
2949 d->qt_rgn->innerRect.width();
2952 for(
int ii = 0; ii <
d->qt_rgn->numRects; ++ii) {
2953 QRect result =
d->qt_rgn->rects[ii] & r;
2955 d->qt_rgn->rects[numRects++] = result;
2957 d->qt_rgn->numRects = numRects;
3050 return d->qt_rgn->extents;
3062 #if 0 // TEST_INNERRECT 3063 static bool guard =
false;
3081 Q_ASSERT(maxArea <= region.d->qt_rgn->innerArea);
3098 d->qt_rgn->vector();
3099 d->qt_rgn->rects.resize(
d->qt_rgn->numRects);
3100 return d->qt_rgn->rects;
3128 if (!rects || num == 0 || (num == 1 && rects->
isEmpty()))
3134 d->qt_rgn->single = *rects;
3136 d->qt_rgn->numRects = num;
3137 d->qt_rgn->extents = *rects;
3138 d->qt_rgn->innerRect = *rects;
3141 d->qt_rgn->rects.resize(num);
3142 d->qt_rgn->numRects = num;
3147 for (
int i = 0; i < num; ++i) {
3148 const QRect &rect = rects[i];
3149 d->qt_rgn->rects[i] = rect;
3154 d->qt_rgn->updateInnerRect(rect);
3176 #ifdef QT_GREENPHONE_OPT static bool isEmptyHelper(const QRegionPrivate *preg)
struct _ScanLineList * next
void append(const QRect *r)
QImage toImage() const
Converts the pixmap to a QImage.
void setHeight(int h)
Sets the height of the rectangle to the given height.
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
QRegionPrivate(const QRect &r)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
The QSemaphore class provides a general counting semaphore.
~QRegion()
Destroys the region.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
static void miSubtractO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, register const QRect *r2, const QRect *r2End, register int y1, register int y2)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
static QRegionPrivate * PolygonRegion(const QPoint *Pts, int Count, int rule, QRegionPrivate *region)
struct _ScanLineListBlock ScanLineListBlock
bool testAndSetAcquire(int expectedValue, int newValue)
Atomic test-and-set.
struct _POINTBLOCK * next
static bool isRect(const T *pts, int elementCount)
struct _EdgeTableEntry * back
static int miCoalesce(register QRegionPrivate &dest, int prevStart, int curStart)
static QRegionPrivate * qt_allocRegion()
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
static bool PointInRegion(QRegionPrivate *pRegion, int x, int y)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
static void PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock, POINTBLOCK *FirstPtBlock, QRegionPrivate *reg)
static void miSubtractNonO1(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, register int y1, register int y2)
void release(int n=1)
Releases n resources guarded by the semaphore.
long ASN1_INTEGER_get ASN1_INTEGER * a
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
QRect boundingRect() const
Returns the bounding rectangle of this region.
The QPolygon class provides a vector of points using integer precision.
QRegion subtract(const QRegion &r) const
Use subtracted(r) instead.
int height() const
Returns the height of the rectangle.
#define EXTENTCHECK(r1, r2)
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
QRegion()
Constructs an empty region.
static void miSetExtents(QRegionPrivate &dest)
static void UnionRegion(const QRegionPrivate *reg1, const QRegionPrivate *reg2, QRegionPrivate &dest)
static bool EqualRegion(const QRegionPrivate *r1, const QRegionPrivate *r2)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
bool operator==(const QRegion &r) const
Returns true if the region is equal to r; otherwise returns false.
static void CreateETandAET(register int count, register const QPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, register EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock)
static struct QRegionData shared_empty
struct _EdgeTableEntry * nextWETE
struct _ScanLineList ScanLineList
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Format format() const
Returns the format of the image.
bool testAndSetRelease(int expectedValue, int newValue)
Atomic test-and-set.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static void miIntersectO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, register const QRect *r2, const QRect *r2End, int y1, int y2)
void resize(int size)
Sets the size of the vector to size.
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
const QRegion operator &(const QRegion &r) const
static QFastMutex qt_nextRegionLock
Q_CORE_EXPORT void qDebug(const char *,...)
#define MEMCHECK(dest, rect, firstrect)
The QBitmap class provides monochrome (1-bit depth) pixmaps.
struct _ScanLineListBlock * next
static QRegionPrivate * qt_allocRegionMemory()
#define QT_BEGIN_NAMESPACE
This macro expands to.
QRegionPrivate * qt_bitmapToRegion(const QBitmap &bitmap, QRegionPrivate *region)
static bool isEmpty(const char *str)
QRegionPrivate(const QRegionPrivate &r)
bool canPrepend(const QRect *r) const
QRegion & operator+=(const QRegion &r)
Applies the united() function to this region and r and assigns the result to this region...
The Rectangle item provides a filled rectangle with an optional border.
static void loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs)
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
static void SubtractRegion(QRegionPrivate *regM, QRegionPrivate *regS, register QRegionPrivate &dest)
static void XorRegion(QRegionPrivate *sra, QRegionPrivate *srb, QRegionPrivate &dest)
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
void updateInnerRect(const QRect &rect)
bool deref()
Atomically decrements the value of this QAtomicInt.
QRegion intersect(const QRegion &r) const
Use intersected(r) instead.
static void computeWAET(register EdgeTableEntry *AET)
void setRight(int pos)
Sets the right edge of the rectangle to the given x coordinate.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static void OffsetRegion(register QRegionPrivate ®ion, register int x, register int y)
bool contains(const QPoint &p) const
Returns true if the region contains the point p; otherwise returns false.
enum QRegionPrivate::@253 mode
The QRegion class specifies a clip region for a painter.
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
EdgeTableEntry * edgelist
QRegion eor(const QRegion &r) const
Use xored(r) instead.
bool canAppend(const QRect *r) const
void(* OverlapFunc)(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, register const QRect *r2, const QRect *r2End, register int y1, register int y2)
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
static int InsertionSort(register EdgeTableEntry *AET)
QRegion & operator=(const QRegion &)
Assigns r to this region and returns a reference to the region.
int fetchAndAddAcquire(int valueToAdd)
Atomic fetch-and-add.
const T & at(int i) const
Returns the item at index position i in the vector.
static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock)
static void cleanUp(QRegionData *x)
QRegion unite(const QRegion &r) const
Use united(r) instead.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
void acquire(int n=1)
Tries to acquire n resources guarded by the semaphore.
static void miRegionOp(register QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, OverlapFunc overlapFunc, NonOverlapFunc nonOverlap1Func, NonOverlapFunc nonOverlap2Func)
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
void setY(int y)
Sets the y coordinate of this point to the given y coordinate.
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
void setRects(const QRect *rect, int num)
Sets the region using the array of rectangles specified by rects and number.
void qt_freeRegion(QRegionPrivate *rp)
int right() const
Returns the x-coordinate of the rectangle's right edge.
bool qt_region_strictContains(const QRegion ®ion, const QRect &rect)
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
int y() const
Returns the y-coordinate of the rectangle's top edge.
static bool RectInRegion(register QRegionPrivate *region, int rx, int ry, uint rwidth, uint rheight)
int x() const
Returns the x-coordinate of the rectangle's left edge.
void(* NonOverlapFunc)(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, register int y1, register int y2)
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void setWidth(int w)
Sets the width of the rectangle to the given width.
The QRect class defines a rectangle in the plane using integer precision.
struct _EdgeTableEntry * next
struct _EdgeTableEntry EdgeTableEntry
int height() const
Returns the height of the image.
QRegionPrivate & operator=(const QRegionPrivate &r)
bool contains(const T &t) const
Returns true if the vector contains an occurrence of value; otherwise returns false.
int y() const
Returns the y coordinate of this point.
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
QList< QPolygonF > toSubpathPolygons(const QMatrix &matrix=QMatrix()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QRegion & operator &=(const QRegion &r)
static void qt_freeRegionMemory(QRegionPrivate *rp)
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
T * data()
Returns a pointer to the data stored in the vector.
const T * constData() const
Returns a const pointer to the data stored in the vector.
int x() const
Returns the x coordinate of this point.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres)
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
static void miUnionO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, register const QRect *r2, const QRect *r2End, register int y1, register int y2)
static void UnionRectWithRegion(register const QRect *rect, const QRegionPrivate *source, QRegionPrivate &dest)
void prepend(const QRect *r)
#define CONTAINSCHECK(r1, r2)
bool contains(const QRegionPrivate &r) const
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
void addEllipse(const QRectF &rect)
Creates an ellipse within the specified boundingRectangle and adds it to the painter path as a closed...
static void miUnionNonO(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, register int y1, register int y2)
struct _POINTBLOCK POINTBLOCK
static int area(const QSize &s)
void qt_mac_dispose_rgn(RgnHandle r)
static void FreeStorage(register ScanLineListBlock *pSLLBlock)
static QRegionPrivate * qt_nextRegionPtr