#include <kis_wrapped_rect.h>
|
| static QRect | clipToWrapRect (QRect rc, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static QVector< QRect > | multiplyWrappedRect (const QRect &rc, const QRect &wrapRect, const QRect &limitRect, WrapAroundAxis wrapAxis) |
| |
| static QVector< QPoint > | normalizationOriginsForRect (const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static QPoint | ptToWrappedPt (QPoint pt, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static bool | wrapRectContains (const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static bool | wrapRectContains (QPoint pt, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static int | xToWrappedX (int x, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
| static int | yToWrappedY (int y, const QRect &wrapRect, WrapAroundAxis wrapAxis) |
| |
Definition at line 16 of file kis_wrapped_rect.h.
◆ anonymous enum
◆ KisWrappedRect()
| KisWrappedRect::KisWrappedRect |
( |
const QRect & | rc, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inline |
Definition at line 181 of file kis_wrapped_rect.h.
184 {
186 append(rc);
187 } else {
192
193
194
196
197 QRect newRect(x, y, w, h);
198
199
200
201
209 }
210 }
static int yToWrappedY(int y, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static bool wrapRectContains(const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static QRect clipToWrapRect(QRect rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static int xToWrappedX(int x, const QRect &wrapRect, WrapAroundAxis wrapAxis)
References clipToWrapRect(), WRAPAROUND_BOTH, WRAPAROUND_HORIZONTAL, WRAPAROUND_VERTICAL, wrapRect(), wrapRectContains(), xToWrappedX(), and yToWrappedY().
◆ bottomLeft()
| QRect KisWrappedRect::bottomLeft |
( |
| ) |
const |
|
inline |
◆ bottomRight()
| QRect KisWrappedRect::bottomRight |
( |
| ) |
const |
|
inline |
◆ clipToWrapRect()
| static QRect KisWrappedRect::clipToWrapRect |
( |
QRect | rc, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ isSplit()
| bool KisWrappedRect::isSplit |
( |
| ) |
const |
|
inline |
Definition at line 212 of file kis_wrapped_rect.h.
212 {
213 int size = this->size();
214
215
216 Q_ASSERT(size == 1 || size == 4);
217
219 }
int size(const Forest< T > &forest)
◆ multiplyWrappedRect()
| static QVector< QRect > KisWrappedRect::multiplyWrappedRect |
( |
const QRect & | rc, |
|
|
const QRect & | wrapRect, |
|
|
const QRect & | limitRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
Definition at line 134 of file kis_wrapped_rect.h.
137 {
138
140
141 const int firstCol =
143 const int firstRow =
145
146 const int lastCol =
148 const int lastRow =
150
152
153 Q_FOREACH (
const QRect &
rect, wrappedRect) {
154 if (
rect.isEmpty())
continue;
155
156 for (
int y = firstRow;
y <= lastRow;
y++) {
157 for (
int x = firstCol;
x <= lastCol;
x++) {
159 const QRect currentRect =
160 rect.translated(offset +
wrapRect.topLeft()) & limitRect;
161
162 if (!currentRect.isEmpty()) {
163 result << currentRect;
164 }
165 }
166 }
167 }
168
169 return result;
170 }
References WRAPAROUND_HORIZONTAL, WRAPAROUND_VERTICAL, and wrapRect().
◆ normalizationOriginsForRect()
| static QVector< QPoint > KisWrappedRect::normalizationOriginsForRect |
( |
const QRect & | rc, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
Return origins at which we should paint rc with crop rect set to wrapRect, so that the final image would look "wrapped".
Definition at line 93 of file kis_wrapped_rect.h.
93 {
95
97 result.append(rc.topLeft());
98 }
99 else {
104
105
106
108
109 QRect newRect(x, y, w, h);
110
112 result.append(QPoint(x, y));
113 }
114
117 result.append(QPoint(x -
wrapRect.width(), y));
118 }
119
122 result.append(QPoint(x, y -
wrapRect.height()));
123 }
124
128 }
129 }
130
131 return result;
132 }
References clipToWrapRect(), WRAPAROUND_BOTH, WRAPAROUND_HORIZONTAL, WRAPAROUND_VERTICAL, wrapRect(), wrapRectContains(), xToWrappedX(), and yToWrappedY().
◆ originalRect()
| QRect KisWrappedRect::originalRect |
( |
| ) |
const |
|
inline |
◆ ptToWrappedPt()
| static QPoint KisWrappedRect::ptToWrappedPt |
( |
QPoint | pt, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ topLeft()
| QRect KisWrappedRect::topLeft |
( |
| ) |
const |
|
inline |
◆ topRight()
| QRect KisWrappedRect::topRight |
( |
| ) |
const |
|
inline |
◆ wrapRect()
| QRect KisWrappedRect::wrapRect |
( |
| ) |
const |
|
inline |
◆ wrapRectContains() [1/2]
| static bool KisWrappedRect::wrapRectContains |
( |
const QRect & | rc, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ wrapRectContains() [2/2]
| static bool KisWrappedRect::wrapRectContains |
( |
QPoint | pt, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ xToWrappedX()
| static int KisWrappedRect::xToWrappedX |
( |
int | x, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ yToWrappedY()
| static int KisWrappedRect::yToWrappedY |
( |
int | y, |
|
|
const QRect & | wrapRect, |
|
|
WrapAroundAxis | wrapAxis ) |
|
inlinestatic |
◆ m_originalRect
| QRect KisWrappedRect::m_originalRect |
|
private |
◆ m_wrapRect
| QRect KisWrappedRect::m_wrapRect |
|
private |
The documentation for this struct was generated from the following file: