Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWrapAroundBoundsWrapper Class Reference

The KisWrapAroundBoundsWrapper class wrapper around a KisDefaultBoundsBaseSP to enable wraparound. Used for patterns. More...

#include <kis_default_bounds.h>

+ Inheritance diagram for KisWrapAroundBoundsWrapper:

Public Member Functions

QRect bounds () const override
 
int currentLevelOfDetail () const override
 
int currentTime () const override
 
bool externalFrameActive () const override
 
 KisWrapAroundBoundsWrapper (KisDefaultBoundsBaseSP base, QRect bounds)
 
voidsourceCookie () const override
 
bool wrapAroundMode () const override
 
WrapAroundAxis wrapAroundModeAxis () const override
 
 ~KisWrapAroundBoundsWrapper () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisDefaultBoundsBase
virtual QRect imageBorderRect () const
 
virtual ~KisDefaultBoundsBase ()
 
- Public Member Functions inherited from KisShared
bool deref ()
 
bool ref ()
 
int refCount ()
 
QAtomicInt * sharedWeakReference ()
 

Public Attributes

KisDefaultBoundsBaseSP base
 
QRect bounds
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Private Attributes

const QScopedPointer< Privatem_d
 

Friends

class KisPaintDeviceTest
 

Additional Inherited Members

- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 

Detailed Description

The KisWrapAroundBoundsWrapper class wrapper around a KisDefaultBoundsBaseSP to enable wraparound. Used for patterns.

Definition at line 180 of file kis_default_bounds.cpp.

Constructor & Destructor Documentation

◆ KisWrapAroundBoundsWrapper()

KisWrapAroundBoundsWrapper::KisWrapAroundBoundsWrapper ( KisDefaultBoundsBaseSP base,
QRect bounds )

Definition at line 186 of file kis_default_bounds.cpp.

187: m_d(new Private())
188{
189 m_d->base = base;
190 m_d->bounds = bounds;
191}
virtual QRect bounds() const =0
const QScopedPointer< Private > m_d

References base, bounds, KisDefaultBoundsBase::bounds(), and m_d.

◆ ~KisWrapAroundBoundsWrapper()

KisWrapAroundBoundsWrapper::~KisWrapAroundBoundsWrapper ( )
override

Definition at line 193 of file kis_default_bounds.cpp.

194{
195}

Member Function Documentation

◆ bounds()

QRect KisWrapAroundBoundsWrapper::bounds ( ) const
overridevirtual

Returns a virtual bounding rect of a paint device. E.g. when a paint device has non-transparent default pixel, its virtual bounds extend much wider than the actual data it contains.

This bounds rectangle should be used in all the cases when one wants to process all the non-existing pixels with default value, which may still be visible to the user.

The returned rect usually equals to the bounds of the image, except of a few special cases for selections.

Example:

KisPaintDevice adds defaultBounds->bounds() to its extent() and exactBounds() when its default pixel is non-transparent.

Implements KisDefaultBoundsBase.

◆ currentLevelOfDetail()

int KisWrapAroundBoundsWrapper::currentLevelOfDetail ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 212 of file kis_default_bounds.cpp.

213{
214 return m_d->base->currentLevelOfDetail();
215}

References m_d.

◆ currentTime()

int KisWrapAroundBoundsWrapper::currentTime ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 217 of file kis_default_bounds.cpp.

218{
219 return m_d->base->currentTime();
220}

References m_d.

◆ externalFrameActive()

bool KisWrapAroundBoundsWrapper::externalFrameActive ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 222 of file kis_default_bounds.cpp.

223{
224 return m_d->base->externalFrameActive();
225}

References m_d.

◆ sourceCookie()

void * KisWrapAroundBoundsWrapper::sourceCookie ( ) const
overridevirtual

Return an abstract pointer to the source object, where default bounds takes its data from. It the cookie is nullptr, then the default bounds is not connected to anything. One can also compare if two default bounds are connected to the same source by comparing two pointers.

NOTE: It is intended to be used for debugging purposes only!

Implements KisDefaultBoundsBase.

Definition at line 227 of file kis_default_bounds.cpp.

228{
229 return m_d->base->sourceCookie();
230}

References m_d.

◆ wrapAroundMode()

bool KisWrapAroundBoundsWrapper::wrapAroundMode ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 202 of file kis_default_bounds.cpp.

203{
204 return true;
205}

◆ wrapAroundModeAxis()

WrapAroundAxis KisWrapAroundBoundsWrapper::wrapAroundModeAxis ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 207 of file kis_default_bounds.cpp.

208{
209 return m_d->base->wrapAroundModeAxis();
210}

References m_d.

Friends And Related Symbol Documentation

◆ KisPaintDeviceTest

friend class KisPaintDeviceTest
friend

Definition at line 100 of file kis_default_bounds.h.

Member Data Documentation

◆ base

KisDefaultBoundsBaseSP KisWrapAroundBoundsWrapper::base

Definition at line 182 of file kis_default_bounds.cpp.

◆ bounds

QRect KisWrapAroundBoundsWrapper::bounds

Definition at line 183 of file kis_default_bounds.cpp.

◆ m_d

const QScopedPointer<Private> KisWrapAroundBoundsWrapper::m_d
private

Definition at line 106 of file kis_default_bounds.h.


The documentation for this class was generated from the following files: