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 221 of file kis_default_bounds.cpp.

Constructor & Destructor Documentation

◆ KisWrapAroundBoundsWrapper()

KisWrapAroundBoundsWrapper::KisWrapAroundBoundsWrapper ( KisDefaultBoundsBaseSP base,
QRect bounds )

Definition at line 227 of file kis_default_bounds.cpp.

228: m_d(new Private())
229{
230 m_d->base = base;
231 m_d->bounds = bounds;
232}
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 234 of file kis_default_bounds.cpp.

235{
236}

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 253 of file kis_default_bounds.cpp.

254{
255 return m_d->base->currentLevelOfDetail();
256}

References m_d.

◆ currentTime()

int KisWrapAroundBoundsWrapper::currentTime ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 258 of file kis_default_bounds.cpp.

259{
260 return m_d->base->currentTime();
261}

References m_d.

◆ externalFrameActive()

bool KisWrapAroundBoundsWrapper::externalFrameActive ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 263 of file kis_default_bounds.cpp.

264{
265 return m_d->base->externalFrameActive();
266}

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 268 of file kis_default_bounds.cpp.

269{
270 return m_d->base->sourceCookie();
271}

References m_d.

◆ wrapAroundMode()

bool KisWrapAroundBoundsWrapper::wrapAroundMode ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 243 of file kis_default_bounds.cpp.

244{
245 return true;
246}

◆ wrapAroundModeAxis()

WrapAroundAxis KisWrapAroundBoundsWrapper::wrapAroundModeAxis ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 248 of file kis_default_bounds.cpp.

249{
250 return m_d->base->wrapAroundModeAxis();
251}

References m_d.

Friends And Related Symbol Documentation

◆ KisPaintDeviceTest

friend class KisPaintDeviceTest
friend

Definition at line 159 of file kis_default_bounds.h.

Member Data Documentation

◆ base

KisDefaultBoundsBaseSP KisWrapAroundBoundsWrapper::base

Definition at line 223 of file kis_default_bounds.cpp.

◆ bounds

QRect KisWrapAroundBoundsWrapper::bounds

Definition at line 224 of file kis_default_bounds.cpp.

◆ m_d

const QScopedPointer<Private> KisWrapAroundBoundsWrapper::m_d
private

Definition at line 165 of file kis_default_bounds.h.


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