chalk

KisPaintLayer Class Reference

#include <kis_paint_layer.h>

Inheritance diagram for KisPaintLayer:
KisLayer

Signals

void sigMaskInfoChanged ()

Public Member Functions

 KisPaintLayer (KisImage *img, const TQString &name, TQ_UINT8 opacity, KisPaintDeviceSP dev)
 KisPaintLayer (KisImage *img, const TQString &name, TQ_UINT8 opacity)
 KisPaintLayer (KisImage *img, const TQString &name, TQ_UINT8 opacity, KisColorSpace *colorSpace)
 KisPaintLayer (const KisPaintLayer &rhs)
virtual KisLayerSP clone () const
virtual void activate ()
virtual void deactivate ()
virtual TQ_INT32 x () const
virtual void setX (TQ_INT32 x)
virtual TQ_INT32 y () const
virtual void setY (TQ_INT32 y)
virtual TQRect extent () const
virtual TQRect exactBounds () const
virtual void paintSelection (TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
virtual void paintSelection (TQImage &img, const TQRect &scaledImageRect, const TQSize &scaledImageSize, const TQSize &imageSize)
virtual void paintMaskInactiveLayers (TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
virtual TQImage createThumbnail (TQ_INT32 w, TQ_INT32 h)
virtual bool accept (KisLayerVisitor &v)
KisPaintDeviceSP paintDevice () const
KisPaintDeviceSP paintDeviceOrMask () const
bool hasMask () const
KisPaintDeviceSP createMask ()
void createMaskFromPaintDevice (KisPaintDeviceSP from)
void createMaskFromSelection (KisSelectionSP from)
void removeMask ()
void applyMask ()
KisPaintDeviceSP getMask ()
KisSelectionSP getMaskAsSelection ()
KNamedCommand * createMaskCommand ()
KNamedCommand * maskFromSelectionCommand ()
KNamedCommand * maskToSelectionCommand ()
KNamedCommand * removeMaskCommand ()
KNamedCommand * applyMaskCommand ()
bool renderMask () const
void setRenderMask (bool b)
bool editMask () const
void setEditMask (bool b)
virtual void setDirty (bool propagate=true)
virtual void setDirty (const TQRect &rect, bool propagate=true)
virtual KisLayer * layer ()
Public Member Functions inherited from KisLayer
 KisLayer (KisImage *img, const TQString &name, TQ_UINT8 opacity)
 KisLayer (const KisLayer &rhs)
virtual void setClean (const TQRect &rect)
virtual bool dirty ()
virtual bool dirty (const TQRect &rc)
virtual TQRect dirtyRect () const
int id () const
virtual int index () const
virtual void setIndex (int index)
virtual KisGroupLayerSP parent () const
virtual KisLayerSP prevSibling () const
virtual KisLayerSP nextSibling () const
KisLayerSP siblingAbove () const
KisLayerSP siblingBelow () const
virtual uint childCount () const
virtual KisLayerSP firstChild () const
virtual KisLayerSP lastChild () const
virtual KisLayerSP findLayer (const TQString &name) const
virtual KisLayerSP findLayer (int id) const
virtual int numLayers (int type=0) const
virtual KNamedCommand * moveCommand (TQPoint oldPosition, TQPoint newPosition)
virtual const bool visible () const
virtual void setVisible (bool v)
KNamedCommand * setVisibleCommand (bool visiblel)
TQ_UINT8 opacity () const
void setOpacity (TQ_UINT8 val)
KNamedCommand * setOpacityCommand (TQ_UINT8 val)
KNamedCommand * setOpacityCommand (TQ_UINT8 prevOpacity, TQ_UINT8 newOpacity)
bool locked () const
void setLocked (bool l)
KNamedCommand * setLockedCommand (bool locked)
void notifyPropertyChanged ()
bool temporary () const
void setTemporary (bool t)
virtual TQString name () const
virtual void setName (const TQString &name)
KisCompositeOp compositeOp ()
void setCompositeOp (const KisCompositeOp &compositeOp)
KNamedCommand * setCompositeOpCommand (const KisCompositeOp &compositeOp)
KisImage * image () const
virtual void setImage (KisImage *image)
KisUndoAdapter * undoAdapter () const

Additional Inherited Members

Public Types inherited from KisLayer
enum  { Visible = 1 , Hidden = 2 , Locked = 4 , Unlocked = 8 }

Detailed Description

This layer is of a type that can be painted on.

Definition at line 28 of file kis_paint_layer.h.

Constructor & Destructor Documentation

◆ KisPaintLayer() [1/4]

KisPaintLayer::KisPaintLayer ( KisImage * img,
const TQString & name,
TQ_UINT8 opacity,
KisPaintDeviceSP dev )

Definition at line 36 of file kis_paint_layer.cpp.

◆ KisPaintLayer() [2/4]

KisPaintLayer::KisPaintLayer ( KisImage * img,
const TQString & name,
TQ_UINT8 opacity )

Definition at line 50 of file kis_paint_layer.cpp.

◆ KisPaintLayer() [3/4]

KisPaintLayer::KisPaintLayer ( KisImage * img,
const TQString & name,
TQ_UINT8 opacity,
KisColorSpace * colorSpace )

Definition at line 61 of file kis_paint_layer.cpp.

◆ KisPaintLayer() [4/4]

KisPaintLayer::KisPaintLayer ( const KisPaintLayer & rhs)

Definition at line 73 of file kis_paint_layer.cpp.

◆ ~KisPaintLayer()

KisPaintLayer::~KisPaintLayer ( )
virtual

Definition at line 91 of file kis_paint_layer.cpp.

Member Function Documentation

◆ accept()

virtual bool KisPaintLayer::accept ( KisLayerVisitor & )
inlinevirtual

Accept the KisLayerVisitor (for the Visitor design pattern), should call the correct function on the KisLayerVisitor for this layer type.

Implements KisLayer.

Definition at line 66 of file kis_paint_layer.h.

◆ activate()

virtual void KisPaintLayer::activate ( )
inlinevirtual

Called when the layer is made active.

Reimplemented from KisLayer.

Definition at line 45 of file kis_paint_layer.h.

◆ applyMask()

void KisPaintLayer::applyMask ( )

Apply the layer mask to the paint device, this removes the mask afterwards.

Definition at line 203 of file kis_paint_layer.cpp.

◆ applyMaskCommand()

KNamedCommand * KisPaintLayer::applyMaskCommand ( )

Undoable version of applyMask.

Definition at line 504 of file kis_paint_layer.cpp.

◆ clone()

KisLayerSP KisPaintLayer::clone ( ) const
virtual

Return a copy of this layer.

Implements KisLayer.

Definition at line 86 of file kis_paint_layer.cpp.

◆ createMask()

KisPaintDeviceSP KisPaintLayer::createMask ( )

Create a mask if it does not yet exist, and return it.

Definition at line 222 of file kis_paint_layer.cpp.

◆ createMaskCommand()

KNamedCommand * KisPaintLayer::createMaskCommand ( )

Undoable version of createMask.

Definition at line 487 of file kis_paint_layer.cpp.

◆ createMaskFromPaintDevice()

void KisPaintLayer::createMaskFromPaintDevice ( KisPaintDeviceSP from)

Convert the from argument to the mask.

Definition at line 239 of file kis_paint_layer.cpp.

◆ createMaskFromSelection()

void KisPaintLayer::createMaskFromSelection ( KisSelectionSP from)

Convert the from selection to a paint device (should convert the getMaskAsSelection result back to the mask).

Overwrites the current mask, if any. Also removes the selection

Definition at line 249 of file kis_paint_layer.cpp.

◆ createThumbnail()

TQImage KisPaintLayer::createThumbnail ( TQ_INT32 w,
TQ_INT32 h )
virtual

Returns a thumbnail in requested size.

The TQImage may have transparent parts. May also return 0

Reimplemented from KisLayer.

Definition at line 143 of file kis_paint_layer.cpp.

◆ deactivate()

virtual void KisPaintLayer::deactivate ( )
inlinevirtual

Called when another layer is made active.

Reimplemented from KisLayer.

Definition at line 48 of file kis_paint_layer.h.

◆ editMask()

bool KisPaintLayer::editMask ( ) const
inline

When this returns true, the KisPaintDevice returned in paintDevice will actually be the layer mask (if there is one).

This is so that tools can draw on the mask without needing to know its existance.

Definition at line 127 of file kis_paint_layer.h.

◆ exactBounds()

TQRect KisPaintLayer::exactBounds ( ) const
virtual

Returns the exact bounds of where the actual data resides in this layer.

Implements KisLayer.

Definition at line 183 of file kis_paint_layer.cpp.

◆ extent()

TQRect KisPaintLayer::extent ( ) const
virtual

Returns an approximation of where the bounds on actual data are in this layer.

Implements KisLayer.

Definition at line 176 of file kis_paint_layer.cpp.

◆ getMask()

KisPaintDeviceSP KisPaintLayer::getMask ( )

Returns the layer mask's device. Creates one if there is currently none.

Definition at line 286 of file kis_paint_layer.cpp.

◆ getMaskAsSelection()

KisSelectionSP KisPaintLayer::getMaskAsSelection ( )

Returns the layer mask's device, converted to a selection. Creates one if there is currently none.

Definition at line 292 of file kis_paint_layer.cpp.

◆ hasMask()

bool KisPaintLayer::hasMask ( ) const
inline

Does this layer have a layer mask?

Definition at line 86 of file kis_paint_layer.h.

◆ layer()

virtual KisLayer * KisPaintLayer::layer ( )
inlinevirtual

Definition at line 137 of file kis_paint_layer.h.

◆ maskFromSelectionCommand()

KNamedCommand * KisPaintLayer::maskFromSelectionCommand ( )

Undoable version of createMaskFromSelection.

Definition at line 491 of file kis_paint_layer.cpp.

◆ maskToSelectionCommand()

KNamedCommand * KisPaintLayer::maskToSelectionCommand ( )

Undoable, removes the current mask, but converts it to the current selection.

Definition at line 495 of file kis_paint_layer.cpp.

◆ paintDevice()

KisPaintDeviceSP KisPaintLayer::paintDevice ( ) const
inline

Definition at line 74 of file kis_paint_layer.h.

◆ paintDeviceOrMask()

KisPaintDeviceSP KisPaintLayer::paintDeviceOrMask ( ) const
inline

Returns the paintDevice that accompanies this layer (or mask, see editMask).

Definition at line 77 of file kis_paint_layer.h.

◆ paintMaskInactiveLayers()

void KisPaintLayer::paintMaskInactiveLayers ( TQImage & img,
TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_INT32 h )
virtual

paints where no data is on this layer. Useful when it is a transparent layer stacked on top of another one

Reimplemented from KisLayer.

Definition at line 119 of file kis_paint_layer.cpp.

◆ paintSelection() [1/2]

void KisPaintLayer::paintSelection ( TQImage & img,
const TQRect & scaledImageRect,
const TQSize & scaledImageSize,
const TQSize & imageSize )
virtual

Reimplemented from KisLayer.

Definition at line 110 of file kis_paint_layer.cpp.

◆ paintSelection() [2/2]

void KisPaintLayer::paintSelection ( TQImage & img,
TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_INT32 h )
virtual

paints a mask where the selection on this layer resides

Reimplemented from KisLayer.

Definition at line 101 of file kis_paint_layer.cpp.

◆ removeMask()

void KisPaintLayer::removeMask ( )

Remove the layer mask.

Definition at line 190 of file kis_paint_layer.cpp.

◆ removeMaskCommand()

KNamedCommand * KisPaintLayer::removeMaskCommand ( )

Undoable version of removeMask.

Definition at line 500 of file kis_paint_layer.cpp.

◆ renderMask()

bool KisPaintLayer::renderMask ( ) const
inline

Returns true if the masked part of the mask will be rendered instead of being transparent.

Definition at line 118 of file kis_paint_layer.h.

◆ setDirty() [1/2]

void KisPaintLayer::setDirty ( bool propagate = true)
virtual

Overridden to call the private convertMaskToSelection.

Reimplemented from KisLayer.

Definition at line 341 of file kis_paint_layer.cpp.

◆ setDirty() [2/2]

void KisPaintLayer::setDirty ( const TQRect & rect,
bool propagate = true )
virtual

Same as above.

Reimplemented from KisLayer.

Definition at line 347 of file kis_paint_layer.cpp.

◆ setEditMask()

void KisPaintLayer::setEditMask ( bool b)

Sets the editMask property.

Definition at line 298 of file kis_paint_layer.cpp.

◆ setRenderMask()

void KisPaintLayer::setRenderMask ( bool b)

Set the renderMask property.

Definition at line 303 of file kis_paint_layer.cpp.

◆ setX()

void KisPaintLayer::setX ( TQ_INT32 x)
virtual

Implements KisLayer.

Definition at line 158 of file kis_paint_layer.cpp.

◆ setY()

void KisPaintLayer::setY ( TQ_INT32 y)
virtual

Implements KisLayer.

Definition at line 171 of file kis_paint_layer.cpp.

◆ sigMaskInfoChanged

void KisPaintLayer::sigMaskInfoChanged ( )
signal

When the mask is created/destroyed or the editmask or rendermask is changed.

◆ x()

TQ_INT32 KisPaintLayer::x ( ) const
virtual

Implements KisLayer.

Definition at line 152 of file kis_paint_layer.cpp.

◆ y()

TQ_INT32 KisPaintLayer::y ( ) const
virtual

Implements KisLayer.

Definition at line 164 of file kis_paint_layer.cpp.


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