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

#include <kis_layer_style_filter_environment.h>

+ Inheritance diagram for KisLayerStyleFilterEnvironment:

Public Member Functions

KoPatternSP cachedFlattenedPattern (KoPatternSP pattern) const
 
KisCachedPaintDevicecachedPaintDevice ()
 
KisPixelSelectionSP cachedRandomSelection (const QRect &requestedRect) const
 
KisCachedSelectioncachedSelection ()
 
int currentLevelOfDetail () const
 
QRect defaultBounds () const
 
 KisLayerStyleFilterEnvironment (KisLayer *sourceLayer)
 
QRect layerBounds () const
 
void setupFinalPainter (KisPainter *gc, quint8 opacity, const QBitArray &channelFlags) const
 
 ~KisLayerStyleFilterEnvironment ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Static Public Member Functions

static KisPixelSelectionSP generateRandomSelection (const QRect &rc)
 

Public Attributes

KisLocalStrokeResources cachedFlattenedPattern
 
KisPixelSelectionSP cachedRandomSelection
 
KisCachedPaintDevice globalCachedPaintDevice
 
KisCachedSelection globalCachedSelection
 
KisLayersourceLayer
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

Definition at line 28 of file kis_layer_style_filter_environment.cpp.

Constructor & Destructor Documentation

◆ KisLayerStyleFilterEnvironment()

KisLayerStyleFilterEnvironment::KisLayerStyleFilterEnvironment ( KisLayer * sourceLayer)

Definition at line 72 of file kis_layer_style_filter_environment.cpp.

73 : m_d(new Private)
74{
75 Q_ASSERT(sourceLayer);
76 m_d->sourceLayer = sourceLayer;
77}

References m_d, and sourceLayer.

◆ ~KisLayerStyleFilterEnvironment()

KisLayerStyleFilterEnvironment::~KisLayerStyleFilterEnvironment ( )

Definition at line 79 of file kis_layer_style_filter_environment.cpp.

80{
81}

Member Function Documentation

◆ cachedFlattenedPattern()

KoPatternSP KisLayerStyleFilterEnvironment::cachedFlattenedPattern ( KoPatternSP pattern) const

◆ cachedPaintDevice()

KisCachedPaintDevice * KisLayerStyleFilterEnvironment::cachedPaintDevice ( )

Definition at line 149 of file kis_layer_style_filter_environment.cpp.

150{
151 return &m_d->globalCachedPaintDevice;
152}

References m_d.

◆ cachedRandomSelection()

KisPixelSelectionSP KisLayerStyleFilterEnvironment::cachedRandomSelection ( const QRect & requestedRect) const

◆ cachedSelection()

KisCachedSelection * KisLayerStyleFilterEnvironment::cachedSelection ( )

Definition at line 144 of file kis_layer_style_filter_environment.cpp.

145{
146 return &m_d->globalCachedSelection;
147}

References m_d.

◆ currentLevelOfDetail()

int KisLayerStyleFilterEnvironment::currentLevelOfDetail ( ) const

Definition at line 94 of file kis_layer_style_filter_environment.cpp.

95{
96 return m_d->sourceLayer ?
97 m_d->sourceLayer->original()->defaultBounds()->currentLevelOfDetail() : 0;
98}

References m_d.

◆ defaultBounds()

QRect KisLayerStyleFilterEnvironment::defaultBounds ( ) const

Definition at line 88 of file kis_layer_style_filter_environment.cpp.

89{
90 return m_d->sourceLayer ?
91 m_d->sourceLayer->original()->defaultBounds()->bounds() : QRect();
92}

References m_d.

◆ generateRandomSelection()

static KisPixelSelectionSP KisLayerStyleFilterEnvironment::generateRandomSelection ( const QRect & rc)
static

◆ layerBounds()

QRect KisLayerStyleFilterEnvironment::layerBounds ( ) const

Definition at line 83 of file kis_layer_style_filter_environment.cpp.

84{
85 return m_d->sourceLayer ? m_d->sourceLayer->projection()->exactBounds() : QRect();
86}

References m_d.

◆ setupFinalPainter()

void KisLayerStyleFilterEnvironment::setupFinalPainter ( KisPainter * gc,
quint8 opacity,
const QBitArray & channelFlags ) const

Definition at line 100 of file kis_layer_style_filter_environment.cpp.

103{
104 Q_ASSERT(m_d->sourceLayer);
105 gc->setOpacityF(KritaUtils::mergeOpacityF(qreal(opacity) / OPACITY_OPAQUE_U8, qreal(m_d->sourceLayer->opacity()) / OPACITY_OPAQUE_U8));
106 gc->setChannelFlags(KritaUtils::mergeChannelFlags(channelFlags, m_d->sourceLayer->channelFlags()));
107
108}
const quint8 OPACITY_OPAQUE_U8
void setOpacityF(qreal opacity)
void setChannelFlags(QBitArray channelFlags)
qreal mergeOpacityF(qreal opacity, qreal parentOpacity)
QBitArray mergeChannelFlags(const QBitArray &childFlags, const QBitArray &parentFlags)

References m_d, KritaUtils::mergeChannelFlags(), KritaUtils::mergeOpacityF(), OPACITY_OPAQUE_U8, KisPainter::setChannelFlags(), and KisPainter::setOpacityF().

Member Data Documentation

◆ cachedFlattenedPattern

KoPatternSP KisLayerStyleFilterEnvironment::cachedFlattenedPattern

Definition at line 34 of file kis_layer_style_filter_environment.cpp.

◆ cachedRandomSelection

KisPixelSelectionSP KisLayerStyleFilterEnvironment::cachedRandomSelection

Definition at line 31 of file kis_layer_style_filter_environment.cpp.

◆ globalCachedPaintDevice

KisCachedPaintDevice KisLayerStyleFilterEnvironment::globalCachedPaintDevice

Definition at line 33 of file kis_layer_style_filter_environment.cpp.

◆ globalCachedSelection

KisCachedSelection KisLayerStyleFilterEnvironment::globalCachedSelection

Definition at line 32 of file kis_layer_style_filter_environment.cpp.

◆ m_d

const QScopedPointer<Private> KisLayerStyleFilterEnvironment::m_d
private

Definition at line 48 of file kis_layer_style_filter_environment.h.

◆ sourceLayer

KisLayer* KisLayerStyleFilterEnvironment::sourceLayer

Definition at line 30 of file kis_layer_style_filter_environment.cpp.


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