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

#include <kis_default_bounds.h>

+ Inheritance diagram for KisSelectionDefaultBounds:

Public Member Functions

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

Public Attributes

KisPaintDeviceWSP parentDevice
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Private Attributes

Private *const m_d
 

Additional Inherited Members

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

Detailed Description

Definition at line 89 of file kis_default_bounds.cpp.

Constructor & Destructor Documentation

◆ KisSelectionDefaultBounds()

KisSelectionDefaultBounds::KisSelectionDefaultBounds ( KisPaintDeviceSP parentPaintDevice)

Definition at line 94 of file kis_default_bounds.cpp.

95 : m_d(new Private())
96{
97 m_d->parentDevice = parentDevice;
98}

References m_d, and parentDevice.

◆ ~KisSelectionDefaultBounds()

KisSelectionDefaultBounds::~KisSelectionDefaultBounds ( )
override

Definition at line 100 of file kis_default_bounds.cpp.

101{
102 delete m_d;
103}

References m_d.

Member Function Documentation

◆ bounds()

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

Definition at line 105 of file kis_default_bounds.cpp.

106{
107 return m_d->parentDevice ?
108 m_d->parentDevice->extent() | m_d->parentDevice->defaultBounds()->bounds() : QRect();
109}

References m_d.

◆ currentLevelOfDetail()

int KisSelectionDefaultBounds::currentLevelOfDetail ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 129 of file kis_default_bounds.cpp.

130{
131 return m_d->parentDevice ?
132 m_d->parentDevice->defaultBounds()->currentLevelOfDetail() : 0;
133}

References m_d.

◆ currentTime()

int KisSelectionDefaultBounds::currentTime ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 135 of file kis_default_bounds.cpp.

136{
137 return m_d->parentDevice ?
138 m_d->parentDevice->defaultBounds()->currentTime() : 0;
139}

References m_d.

◆ externalFrameActive()

bool KisSelectionDefaultBounds::externalFrameActive ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 141 of file kis_default_bounds.cpp.

142{
143 return m_d->parentDevice ?
144 m_d->parentDevice->defaultBounds()->externalFrameActive() : false;
145}

References m_d.

◆ imageBorderRect()

QRect KisSelectionDefaultBounds::imageBorderRect ( ) const
overridevirtual

Returns the rectangle of the official image size. This rect is used for wrapping the device in wrap-around mode and in some specific operations.

NOTE: don't use it unless you know what you are doing, most probably you want to use bounds() instead!

Reimplemented from KisDefaultBoundsBase.

Definition at line 111 of file kis_default_bounds.cpp.

112{
113 return m_d->parentDevice ?
114 m_d->parentDevice->defaultBounds()->bounds() : QRect();
115}

References m_d.

◆ sourceCookie()

void * KisSelectionDefaultBounds::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 147 of file kis_default_bounds.cpp.

148{
149 return m_d->parentDevice.data();
150}

References m_d.

◆ wrapAroundMode()

bool KisSelectionDefaultBounds::wrapAroundMode ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 117 of file kis_default_bounds.cpp.

118{
119 return m_d->parentDevice ?
120 m_d->parentDevice->defaultBounds()->wrapAroundMode() : false;
121}

References m_d.

◆ wrapAroundModeAxis()

WrapAroundAxis KisSelectionDefaultBounds::wrapAroundModeAxis ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 123 of file kis_default_bounds.cpp.

124{
125 return m_d->parentDevice ?
126 m_d->parentDevice->defaultBounds()->wrapAroundModeAxis() : WRAPAROUND_BOTH;
127}
@ WRAPAROUND_BOTH

References m_d, and WRAPAROUND_BOTH.

Member Data Documentation

◆ m_d

Private* const KisSelectionDefaultBounds::m_d
private

Definition at line 68 of file kis_default_bounds.h.

◆ parentDevice

KisPaintDeviceWSP KisSelectionDefaultBounds::parentDevice

Definition at line 91 of file kis_default_bounds.cpp.


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