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

#include <kis_layer_style_filter_projection_plane.h>

+ Inheritance diagram for KisLayerStyleFilterProjectionPlane:

Classes

struct  Private
 

Public Member Functions

QRect accessRect (const QRect &rect, KisLayer::PositionToFilthy pos) const override
 
void apply (KisPainter *painter, const QRect &rect) override
 
QRect changeRect (const QRect &rect, KisLayer::PositionToFilthy pos) const override
 
KisPaintDeviceList getLodCapableDevices () const override
 
bool isEmpty () const
 
 KisLayerStyleFilterProjectionPlane (const KisLayerStyleFilterProjectionPlane &rhs, KisLayer *sourceLayer, KisPSDLayerStyleSP clonedStyle)
 
 KisLayerStyleFilterProjectionPlane (KisLayer *sourceLayer)
 
KisLayerStyleKnockoutBlowerknockoutBlower () const
 
QRect looseUserVisibleBounds () const override
 
QRect needRect (const QRect &rect, KisLayer::PositionToFilthy pos) const override
 
QRect needRectForOriginal (const QRect &rect) const override
 
QRect recalculate (const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags) override
 
void setStyle (KisLayerStyleFilter *filter, KisPSDLayerStyleSP style)
 
QRect tightUserVisibleBounds () const override
 
 ~KisLayerStyleFilterProjectionPlane () override
 
- Public Member Functions inherited from KisAbstractProjectionPlane
 KisAbstractProjectionPlane ()
 
virtual ~KisAbstractProjectionPlane ()
 

Protected Member Functions

KisLayerStyleFilterfilter () const
 
KisPSDLayerStyleSP style () const
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

Definition at line 19 of file kis_layer_style_filter_projection_plane.h.

Constructor & Destructor Documentation

◆ KisLayerStyleFilterProjectionPlane() [1/2]

KisLayerStyleFilterProjectionPlane::KisLayerStyleFilterProjectionPlane ( KisLayer * sourceLayer)

Definition at line 53 of file kis_layer_style_filter_projection_plane.cpp.

55 : m_d(new Private(sourceLayer))
56{
57}

◆ KisLayerStyleFilterProjectionPlane() [2/2]

KisLayerStyleFilterProjectionPlane::KisLayerStyleFilterProjectionPlane ( const KisLayerStyleFilterProjectionPlane & rhs,
KisLayer * sourceLayer,
KisPSDLayerStyleSP clonedStyle )

Definition at line 59 of file kis_layer_style_filter_projection_plane.cpp.

60 : m_d(new Private(*rhs.m_d, sourceLayer, clonedStyle))
61{
62}

◆ ~KisLayerStyleFilterProjectionPlane()

KisLayerStyleFilterProjectionPlane::~KisLayerStyleFilterProjectionPlane ( )
override

Definition at line 64 of file kis_layer_style_filter_projection_plane.cpp.

65{
66}

Member Function Documentation

◆ accessRect()

QRect KisLayerStyleFilterProjectionPlane::accessRect ( const QRect & rect,
KisLayer::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::needRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 146 of file kis_layer_style_filter_projection_plane.cpp.

147{
148 return needRect(rect, pos);
149}
QRect needRect(const QRect &rect, KisLayer::PositionToFilthy pos) const override

References needRect().

◆ apply()

void KisLayerStyleFilterProjectionPlane::apply ( KisPainter * painter,
const QRect & rect )
overridevirtual

Writes the data of the projection plane onto a global projection using painter object.

Implements KisAbstractProjectionPlane.

Definition at line 94 of file kis_layer_style_filter_projection_plane.cpp.

95{
96 m_d->projection.apply(painter->device(), rect, m_d->environment.data());
97}
KisPaintDeviceSP device

References KisPainter::device, and m_d.

◆ changeRect()

QRect KisLayerStyleFilterProjectionPlane::changeRect ( const QRect & rect,
KisLayer::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::changeRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 135 of file kis_layer_style_filter_projection_plane.cpp.

136{
137 if (!m_d->sourceLayer || !m_d->filter) {
138 warnKrita << "KisLayerStyleFilterProjectionPlane::changeRect(): [BUG] is not initialized";
139 return rect;
140 }
141
143 return m_d->filter->changedRect(rect, m_d->style, m_d->environment.data());
144}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97
#define warnKrita
Definition kis_debug.h:87
@ N_ABOVE_FILTHY
Definition kis_node.h:59

References KIS_ASSERT_RECOVER_NOOP, m_d, KisNode::N_ABOVE_FILTHY, and warnKrita.

◆ filter()

KisLayerStyleFilter * KisLayerStyleFilterProjectionPlane::filter ( ) const
protected

Definition at line 114 of file kis_layer_style_filter_projection_plane.cpp.

115{
116 return m_d->filter.data();
117}

References m_d.

◆ getLodCapableDevices()

KisPaintDeviceList KisLayerStyleFilterProjectionPlane::getLodCapableDevices ( ) const
overridevirtual

Returns a list of devices which should synchronize the lod cache on update

Implements KisAbstractProjectionPlane.

Definition at line 99 of file kis_layer_style_filter_projection_plane.cpp.

100{
101 return m_d->projection.getLodCapableDevices();
102}

References m_d.

◆ isEmpty()

bool KisLayerStyleFilterProjectionPlane::isEmpty ( ) const
Returns
true if a call to apply() will actually paint anything. Basically, it is a cached version of isEnabled(), though the state may change after calling to recalculate().

Definition at line 104 of file kis_layer_style_filter_projection_plane.cpp.

105{
106 return m_d->projection.isEmpty();
107}

References m_d.

◆ knockoutBlower()

KisLayerStyleKnockoutBlower * KisLayerStyleFilterProjectionPlane::knockoutBlower ( ) const

Definition at line 109 of file kis_layer_style_filter_projection_plane.cpp.

110{
111 return &m_d->knockoutBlower;
112}

References m_d.

◆ looseUserVisibleBounds()

QRect KisLayerStyleFilterProjectionPlane::looseUserVisibleBounds ( ) const
overridevirtual

Return an approximate (loose) rectangle, where the contents of the plane is placed from user's point of view. It includes everything belonging to the plane (e.g. layer styles).

This rectangle contains or is bigger than the rectangle returned by tightUserVisibleBounds().

Implements KisAbstractProjectionPlane.

Definition at line 166 of file kis_layer_style_filter_projection_plane.cpp.

167{
169 KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(m_d->sourceLayer, QRect());
170
171 return m_d->filter->changedRect(m_d->sourceLayer->extent(),
172 m_d->style,
173 m_d->environment.data());
174}
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129

References KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and m_d.

◆ needRect()

QRect KisLayerStyleFilterProjectionPlane::needRect ( const QRect & rect,
KisLayer::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::needRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 124 of file kis_layer_style_filter_projection_plane.cpp.

125{
126 if (!m_d->sourceLayer || !m_d->filter) {
127 warnKrita << "KisLayerStyleFilterProjectionPlane::needRect(): [BUG] is not initialized";
128 return rect;
129 }
130
132 return m_d->filter->neededRect(rect, m_d->style, m_d->environment.data());
133}

References KIS_ASSERT_RECOVER_NOOP, m_d, KisNode::N_ABOVE_FILTHY, and warnKrita.

◆ needRectForOriginal()

QRect KisLayerStyleFilterProjectionPlane::needRectForOriginal ( const QRect & rect) const
overridevirtual

Works like KisLayer::needRectForOriginal(), but includes needed rects of layer styles

Implements KisAbstractProjectionPlane.

Definition at line 151 of file kis_layer_style_filter_projection_plane.cpp.

152{
154}

References KisNode::N_ABOVE_FILTHY, and needRect().

◆ recalculate()

QRect KisLayerStyleFilterProjectionPlane::recalculate ( const QRect & rect,
KisNodeSP filthyNode,
KisRenderPassFlags flags )
overridevirtual

Is called by the async merger when the node is filthy and should recalculate its internal representation. For usual layers it means just calling updateProjection().

Implements KisAbstractProjectionPlane.

Definition at line 74 of file kis_layer_style_filter_projection_plane.cpp.

75{
76 Q_UNUSED(filthyNode);
77 Q_UNUSED(flags);
78
79 if (!m_d->sourceLayer || !m_d->filter) {
80 warnKrita << "KisLayerStyleFilterProjectionPlane::recalculate(): [BUG] is not initialized";
81 return QRect();
82 }
83
84 m_d->projection.clear(rect);
85 m_d->filter->processDirectly(m_d->sourceLayer->projection(),
86 &m_d->projection,
87 &m_d->knockoutBlower,
88 rect,
89 m_d->style,
90 m_d->environment.data());
91 return rect;
92}

References m_d, and warnKrita.

◆ setStyle()

void KisLayerStyleFilterProjectionPlane::setStyle ( KisLayerStyleFilter * filter,
KisPSDLayerStyleSP style )

Definition at line 68 of file kis_layer_style_filter_projection_plane.cpp.

69{
70 m_d->filter.reset(filter);
71 m_d->style = style;
72}

References filter(), m_d, and style().

◆ style()

KisPSDLayerStyleSP KisLayerStyleFilterProjectionPlane::style ( ) const
protected

Definition at line 119 of file kis_layer_style_filter_projection_plane.cpp.

120{
121 return m_d->style;
122}

References m_d.

◆ tightUserVisibleBounds()

QRect KisLayerStyleFilterProjectionPlane::tightUserVisibleBounds ( ) const
overridevirtual

Return a tight rectangle, where the contents of the plane is placed from user's point of view. It includes everything belonging to the plane (e.g. layer styles).

Implements KisAbstractProjectionPlane.

Definition at line 156 of file kis_layer_style_filter_projection_plane.cpp.

157{
159 KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(m_d->sourceLayer, QRect());
160
161 return m_d->filter->changedRect(m_d->sourceLayer->exactBounds(),
162 m_d->style,
163 m_d->environment.data());
164}

References KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and m_d.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisLayerStyleFilterProjectionPlane::m_d
private

Definition at line 56 of file kis_layer_style_filter_projection_plane.h.


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