Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_default_bounds.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2010 Dmitry Kazakov <dimula73@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8
9#include "kis_global.h"
10#include "kis_default_bounds.h"
11#include "kis_paint_device.h"
13#include "kis_image.h"
14
15
18
19
20/******************************************************************/
21/* KisDefaultBounds */
22/******************************************************************/
23
24struct Q_DECL_HIDDEN KisDefaultBounds::Private
25{
27};
28
33
35 : m_d(new Private())
36{
37 m_d->image = image;
38}
39
44
46{
50 return m_d->image ? m_d->image->effectiveLodBounds() : infiniteRect;
51}
52
54{
55 return m_d->image ? m_d->image->wrapAroundModeActive() : false;
56}
57
59{
60 return m_d->image ? m_d->image->wrapAroundModeAxis() : WRAPAROUND_BOTH;
61}
62
64{
65 return m_d->image ? m_d->image->currentLevelOfDetail() : 0;
66}
67
69{
70 KisImageAnimationInterface *interface = m_d->image ? m_d->image->animationInterface() : 0;
71 return interface ? interface->currentTime() : 0;
72}
73
75{
76 KisImageAnimationInterface *interface = m_d->image ? m_d->image->animationInterface() : 0;
77 return interface ? interface->externalFrameActive() : false;
78}
79
81{
82 return m_d->image.data();
83}
84
85/******************************************************************/
86/* KisSelectionDefaultBounds */
87/******************************************************************/
88
93
99
104
106{
107 return m_d->parentDevice ?
108 m_d->parentDevice->extent() | m_d->parentDevice->defaultBounds()->bounds() : QRect();
109}
110
112{
113 return m_d->parentDevice ?
114 m_d->parentDevice->defaultBounds()->bounds() : QRect();
115}
116
118{
119 return m_d->parentDevice ?
120 m_d->parentDevice->defaultBounds()->wrapAroundMode() : false;
121}
122
124{
125 return m_d->parentDevice ?
126 m_d->parentDevice->defaultBounds()->wrapAroundModeAxis() : WRAPAROUND_BOTH;
127}
128
130{
131 return m_d->parentDevice ?
132 m_d->parentDevice->defaultBounds()->currentLevelOfDetail() : 0;
133}
134
136{
137 return m_d->parentDevice ?
138 m_d->parentDevice->defaultBounds()->currentTime() : 0;
139}
140
142{
143 return m_d->parentDevice ?
144 m_d->parentDevice->defaultBounds()->externalFrameActive() : false;
145}
146
148{
149 return m_d->parentDevice.data();
150}
151
152/******************************************************************/
153/* KisSelectionEmptyBounds */
154/******************************************************************/
155
160
165
169
171{
172 return QRect(0, 0, 0, 0);
173}
174
175/******************************************************************/
176/* KisWrapAroundBoundsWrapper */
177/******************************************************************/
178
179
185
192
196
198{
199 return m_d->bounds;
200}
201
203{
204 return true;
205}
206
208{
209 return m_d->base->wrapAroundModeAxis();
210}
211
213{
214 return m_d->base->currentLevelOfDetail();
215}
216
218{
219 return m_d->base->currentTime();
220}
221
223{
224 return m_d->base->externalFrameActive();
225}
226
228{
229 return m_d->base->sourceCookie();
230}
WrapAroundAxis
@ WRAPAROUND_BOTH
virtual QRect bounds() const =0
QRect bounds() const override
#define bounds(x, a, b)
const qint32 qint32_MIN
Definition kis_global.h:30
const qint32 qint32_MAX
Definition kis_global.h:29
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
int currentLevelOfDetail() const override
void * sourceCookie() const override
static const QRect infiniteRect
WrapAroundAxis wrapAroundModeAxis() const override
int currentTime() const override
bool wrapAroundMode() const override
QRect bounds() const override
bool externalFrameActive() const override
QRect bounds() const override
KisSelectionDefaultBounds(KisPaintDeviceSP parentPaintDevice)
WrapAroundAxis wrapAroundModeAxis() const override
bool wrapAroundMode() const override
void * sourceCookie() const override
QRect imageBorderRect() const override
int currentLevelOfDetail() const override
bool externalFrameActive() const override
int currentTime() const override
The KisWrapAroundBoundsWrapper class wrapper around a KisDefaultBoundsBaseSP to enable wraparound....
void * sourceCookie() const override
bool wrapAroundMode() const override
const QScopedPointer< Private > m_d
WrapAroundAxis wrapAroundModeAxis() const override
bool externalFrameActive() const override
int currentLevelOfDetail() const override
KisWrapAroundBoundsWrapper(KisDefaultBoundsBaseSP base, QRect bounds)