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

#include <kis_default_bounds.h>

+ Inheritance diagram for KisDefaultBounds:

Public Member Functions

QRect bounds () const override
 
int currentLevelOfDetail () const override
 
int currentTime () const override
 
bool externalFrameActive () const override
 
 KisDefaultBounds ()
 
 KisDefaultBounds (KisImageWSP image)
 
voidsourceCookie () const override
 
bool wrapAroundMode () const override
 
WrapAroundAxis wrapAroundModeAxis () const override
 
 ~KisDefaultBounds () 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

KisImageWSP image
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Static Protected Attributes

static const QRect infiniteRect
 

Private Attributes

Private *const m_d
 

Friends

class KisPaintDeviceTest
 

Additional Inherited Members

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

Detailed Description

Definition at line 24 of file kis_default_bounds.cpp.

Constructor & Destructor Documentation

◆ KisDefaultBounds() [1/2]

KisDefaultBounds::KisDefaultBounds ( )

Definition at line 29 of file kis_default_bounds.cpp.

◆ KisDefaultBounds() [2/2]

KisDefaultBounds::KisDefaultBounds ( KisImageWSP image)

Definition at line 34 of file kis_default_bounds.cpp.

35 : m_d(new Private())
36{
37 m_d->image = image;
38}

References image, and m_d.

◆ ~KisDefaultBounds()

KisDefaultBounds::~KisDefaultBounds ( )
override

Definition at line 40 of file kis_default_bounds.cpp.

41{
42 delete m_d;
43}

References m_d.

Member Function Documentation

◆ bounds()

QRect KisDefaultBounds::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.

By default return infinite rect to cover everything

Implements KisDefaultBoundsBase.

Reimplemented in KisSelectionEmptyBounds, ThumbnailBounds, and KisScratchPadDefaultBounds.

Definition at line 45 of file kis_default_bounds.cpp.

46{
50 return m_d->image ? m_d->image->effectiveLodBounds() : infiniteRect;
51}
static const QRect infiniteRect

References infiniteRect, and m_d.

◆ currentLevelOfDetail()

int KisDefaultBounds::currentLevelOfDetail ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 63 of file kis_default_bounds.cpp.

64{
65 return m_d->image ? m_d->image->currentLevelOfDetail() : 0;
66}

References m_d.

◆ currentTime()

int KisDefaultBounds::currentTime ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 68 of file kis_default_bounds.cpp.

69{
70 KisImageAnimationInterface *interface = m_d->image ? m_d->image->animationInterface() : 0;
71 return interface ? interface->currentTime() : 0;
72}
int currentTime() const override

References currentTime(), image, and m_d.

◆ externalFrameActive()

bool KisDefaultBounds::externalFrameActive ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 74 of file kis_default_bounds.cpp.

75{
76 KisImageAnimationInterface *interface = m_d->image ? m_d->image->animationInterface() : 0;
77 return interface ? interface->externalFrameActive() : false;
78}
bool externalFrameActive() const override

References externalFrameActive(), image, and m_d.

◆ sourceCookie()

void * KisDefaultBounds::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.

Reimplemented in KisScratchPadDefaultBounds.

Definition at line 80 of file kis_default_bounds.cpp.

81{
82 return m_d->image.data();
83}

◆ wrapAroundMode()

bool KisDefaultBounds::wrapAroundMode ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 53 of file kis_default_bounds.cpp.

54{
55 return m_d->image ? m_d->image->wrapAroundModeActive() : false;
56}

References m_d.

◆ wrapAroundModeAxis()

WrapAroundAxis KisDefaultBounds::wrapAroundModeAxis ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 58 of file kis_default_bounds.cpp.

59{
60 return m_d->image ? m_d->image->wrapAroundModeAxis() : WRAPAROUND_BOTH;
61}
@ WRAPAROUND_BOTH

References m_d, and WRAPAROUND_BOTH.

Friends And Related Symbol Documentation

◆ KisPaintDeviceTest

friend class KisPaintDeviceTest
friend

Definition at line 39 of file kis_default_bounds.h.

Member Data Documentation

◆ image

KisImageWSP KisDefaultBounds::image

Definition at line 26 of file kis_default_bounds.cpp.

◆ infiniteRect

const QRect KisDefaultBounds::infiniteRect
staticprotected
Initial value:
=
const qint32 qint32_MIN
Definition kis_global.h:30
const qint32 qint32_MAX
Definition kis_global.h:29

Definition at line 40 of file kis_default_bounds.h.

◆ m_d

Private* const KisDefaultBounds::m_d
private

Definition at line 46 of file kis_default_bounds.h.


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