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

#include <kis_cached_paint_device.h>

Classes

struct  Guard
 

Public Member Functions

KisPaintDeviceSP getDevice (KisPaintDeviceSP prototype)
 
KisPaintDeviceSP getDevice (KisPaintDeviceSP prototype, const KoColorSpace *colorSpace)
 
bool isEmpty () const
 
void putDevice (KisPaintDeviceSP device)
 

Private Attributes

KisLocklessStack< KisPaintDeviceSPm_stack
 

Detailed Description

Definition at line 18 of file kis_cached_paint_device.h.

Member Function Documentation

◆ getDevice() [1/2]

KisPaintDeviceSP KisCachedPaintDevice::getDevice ( KisPaintDeviceSP prototype)
inline

Definition at line 21 of file kis_cached_paint_device.h.

21 {
22 KisPaintDeviceSP device;
23
24 if(!m_stack.pop(device)) {
25 device = new KisPaintDevice(prototype->colorSpace());
26 }
27
28 device->prepareClone(prototype);
29 return device;
30 }
KisLocklessStack< KisPaintDeviceSP > m_stack
const KoColorSpace * colorSpace() const
void prepareClone(KisPaintDeviceSP src)

References KisPaintDevice::colorSpace(), m_stack, and KisPaintDevice::prepareClone().

◆ getDevice() [2/2]

KisPaintDeviceSP KisCachedPaintDevice::getDevice ( KisPaintDeviceSP prototype,
const KoColorSpace * colorSpace )
inline

Definition at line 32 of file kis_cached_paint_device.h.

32 {
33 KisPaintDeviceSP device;
34
35 if(!m_stack.pop(device)) {
36 device = new KisPaintDevice(colorSpace);
37 } else {
38 device->convertTo(colorSpace);
39 }
40
41 device->setDefaultPixel(KoColor(colorSpace));
42 device->setDefaultBounds(prototype->defaultBounds());
43 device->setX(prototype->x());
44 device->setY(prototype->y());
45
46 return device;
47 }
void setX(qint32 x)
void setDefaultPixel(const KoColor &defPixel)
void setDefaultBounds(KisDefaultBoundsBaseSP bounds)
KisDefaultBoundsBaseSP defaultBounds() const
void convertTo(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags(), KUndo2Command *parentCommand=nullptr, KoUpdater *progressUpdater=nullptr)
void setY(qint32 y)

References KisPaintDevice::convertTo(), KisPaintDevice::defaultBounds(), m_stack, KisPaintDevice::setDefaultBounds(), KisPaintDevice::setDefaultPixel(), KisPaintDevice::setX(), KisPaintDevice::setY(), KisPaintDevice::x(), and KisPaintDevice::y().

◆ isEmpty()

bool KisCachedPaintDevice::isEmpty ( ) const
inline

Definition at line 55 of file kis_cached_paint_device.h.

55 {
56 return m_stack.isEmpty();
57 }

References m_stack.

◆ putDevice()

void KisCachedPaintDevice::putDevice ( KisPaintDeviceSP device)
inline

Definition at line 49 of file kis_cached_paint_device.h.

49 {
50 device->clear();
52 m_stack.push(device);
53 }
virtual void clear()

References KisPaintDevice::clear(), m_stack, and KisPaintDevice::setDefaultBounds().

Member Data Documentation

◆ m_stack

KisLocklessStack<KisPaintDeviceSP> KisCachedPaintDevice::m_stack
private

Definition at line 86 of file kis_cached_paint_device.h.


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