#include <kis_layer.h>
Public Types | |
| enum | { Visible = 1 , Hidden = 2 , Locked = 4 , Unlocked = 8 } |
Public Member Functions | |
| 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 |
| virtual void | setDirty (bool propagate=true) |
| virtual void | setDirty (const TQRect &rect, bool propagate=true) |
| virtual KisLayerSP | clone () const =0 |
| 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 void | activate () |
| virtual void | deactivate () |
| virtual TQ_INT32 | x () const =0 |
| virtual void | setX (TQ_INT32)=0 |
| virtual TQ_INT32 | y () const =0 |
| virtual void | setY (TQ_INT32)=0 |
| virtual KNamedCommand * | moveCommand (TQPoint oldPosition, TQPoint newPosition) |
| virtual TQRect | extent () const =0 |
| virtual TQRect | exactBounds () const =0 |
| 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 |
| 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 &)=0 |
Friends | |
| class | KisGroupLayer |
Detailed Description
Abstract class that represents the concept of a Layer in Chalk.
This is not related to the paint devices: this is merely an abstraction of how layers can be stacked and rendered differently. Regarding the previous-, first-, next- and lastChild() calls, first means that it the layer is at the top of the group in the layerlist, using next will iterate to the bottom to last, whereas previous will go up to first again.
Definition at line 41 of file kis_layer.h.
Member Enumeration Documentation
◆ anonymous enum
| anonymous enum |
Definition at line 144 of file kis_layer.h.
Constructor & Destructor Documentation
◆ KisLayer() [1/2]
| KisLayer::KisLayer | ( | KisImage * | img, |
| const TQString & | name, | ||
| TQ_UINT8 | opacity | ||
| ) |
Definition at line 269 of file kis_layer.cpp.
◆ KisLayer() [2/2]
| KisLayer::KisLayer | ( | const KisLayer & | rhs | ) |
Definition at line 285 of file kis_layer.cpp.
◆ ~KisLayer()
|
virtual |
Definition at line 304 of file kis_layer.cpp.
Member Function Documentation
◆ accept()
|
pure virtual |
Accept the KisLayerVisitor (for the Visitor design pattern), should call the correct function on the KisLayerVisitor for this layer type.
Implemented in KisAdjustmentLayer, KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
◆ activate()
|
inlinevirtual |
Called when the layer is made active.
Reimplemented in KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
Definition at line 151 of file kis_layer.h.
◆ childCount()
|
inlinevirtual |
Returns how many direct child layers this layer has (not recursive).
Reimplemented in KisGroupLayer.
Definition at line 130 of file kis_layer.h.
◆ clone()
|
pure virtual |
Return a copy of this layer.
Implemented in KisAdjustmentLayer, KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
◆ compositeOp()
|
inline |
Definition at line 191 of file kis_layer.h.
◆ createThumbnail()
|
virtual |
Returns a thumbnail in requested size.
The TQImage may have transparent parts. May also return 0
Reimplemented in KisAdjustmentLayer, KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
Definition at line 576 of file kis_layer.cpp.
◆ deactivate()
|
inlinevirtual |
Called when another layer is made active.
Reimplemented in KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
Definition at line 154 of file kis_layer.h.
◆ dirty() [1/2]
|
virtual |
If the layer has been changed and not been composited yet, this returns true.
Definition at line 320 of file kis_layer.cpp.
◆ dirty() [2/2]
|
virtual |
Return true if the given rect intersects the dirty rect(s) of this layer.
Definition at line 326 of file kis_layer.cpp.
◆ dirtyRect()
|
virtual |
Definition at line 333 of file kis_layer.cpp.
◆ exactBounds()
|
pure virtual |
Returns the exact bounds of where the actual data resides in this layer.
Implemented in KisAdjustmentLayer, KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
◆ extent()
|
pure virtual |
Returns an approximation of where the bounds on actual data are in this layer.
Implemented in KisAdjustmentLayer, KisGroupLayer, KisPaintLayer, and KisPartLayerImpl.
◆ findLayer() [1/2]
|
virtual |
Recursively searches this layer and any child layers for a layer with the specified name.
Definition at line 398 of file kis_layer.cpp.
◆ findLayer() [2/2]
|
virtual |
Recursively searches this layer and any child layers for a layer with the specified ID.
Definition at line 408 of file kis_layer.cpp.
◆ firstChild()
|
inlinevirtual |
Returns the first child layer of this layer (if it supports that).
Reimplemented in KisGroupLayer.
Definition at line 133 of file kis_layer.h.
◆ id()
|
inline |
Returns the ID of the layer, which is guaranteed to be unique among all KisLayers.
Definition at line 88 of file kis_layer.h.
◆ image()
|
inline |
Definition at line 195 of file kis_layer.h.
◆ index()
|
virtual |
Definition at line 386 of file kis_layer.cpp.
◆ lastChild()
|
inlinevirtual |
Returns the last child layer of this layer (if it supports that).
Reimplemented in KisGroupLayer.
Definition at line 136 of file kis_layer.h.
◆ locked()
| bool KisLayer::locked | ( | ) | const |
Definition at line 489 of file kis_layer.cpp.
◆ moveCommand()
|
virtual |
Definition at line 551 of file kis_layer.cpp.
◆ name()
|
virtual |
Definition at line 521 of file kis_layer.cpp.
◆ nextSibling()
|
virtual |
Returns the next sibling of this layer in the parent's list.
This is the layer below this layer. 0 is returned if there is no parent, or if this child has no more next siblings (== lastChild())
Definition at line 379 of file kis_layer.cpp.
◆ notifyPropertyChanged()
| void KisLayer::notifyPropertyChanged | ( | ) |
Definition at line 581 of file kis_layer.cpp.
◆ numLayers()
|
virtual |
Returns the total number of layers in this layer, its child layers, and their child layers recursively, optionally ones with the specified properties Visible or Locked, which you can OR together.
Definition at line 418 of file kis_layer.cpp.
◆ opacity()
| TQ_UINT8 KisLayer::opacity | ( | ) | const |
Definition at line 440 of file kis_layer.cpp.
◆ paintMaskInactiveLayers()
|
virtual |
paints where no data is on this layer. Useful when it is a transparent layer stacked on top of another one
Reimplemented in KisPaintLayer.
Definition at line 564 of file kis_layer.cpp.
◆ paintSelection() [1/2]
|
virtual |
Definition at line 572 of file kis_layer.cpp.
◆ paintSelection() [2/2]
|
virtual |
paints a mask where the selection on this layer resides
Reimplemented in KisAdjustmentLayer, KisPaintLayer, and KisPartLayerImpl.
Definition at line 568 of file kis_layer.cpp.
◆ parent()
|
virtual |
Returns the parent layer of a layer.
This is 0 only for a root layer; otherwise this will be an actual GroupLayer
Definition at line 367 of file kis_layer.cpp.
◆ prevSibling()
|
virtual |
Returns the previous sibling of this layer in the parent's list.
This is the layer above this layer. 0 is returned if there is no parent, or if this child has no more previous siblings (== firstChild())
Definition at line 372 of file kis_layer.cpp.
◆ setClean()
|
virtual |
Set the specified rect to clean.
Definition at line 308 of file kis_layer.cpp.
◆ setCompositeOp()
| void KisLayer::setCompositeOp | ( | const KisCompositeOp & | compositeOp | ) |
Definition at line 535 of file kis_layer.cpp.
◆ setCompositeOpCommand()
| KNamedCommand * KisLayer::setCompositeOpCommand | ( | const KisCompositeOp & | compositeOp | ) |
Definition at line 546 of file kis_layer.cpp.
◆ setDirty() [1/2]
|
virtual |
Set the entire layer extent dirty; this percolates up to parent layers all the way to the root layer.
Reimplemented in KisGroupLayer, and KisPaintLayer.
Definition at line 338 of file kis_layer.cpp.
◆ setDirty() [2/2]
|
virtual |
Add the given rect to the set of dirty rects for this layer; this percolates up to parent layers all the way to the root layer.
Reimplemented in KisGroupLayer, and KisPaintLayer.
Definition at line 352 of file kis_layer.cpp.
◆ setImage()
|
inlinevirtual |
Definition at line 196 of file kis_layer.h.
◆ setIndex()
|
virtual |
Moves this layer to the specified index within its parent's list of child layers.
Definition at line 391 of file kis_layer.cpp.
◆ setLocked()
| void KisLayer::setLocked | ( | bool | l | ) |
Definition at line 494 of file kis_layer.cpp.
◆ setLockedCommand()
| KNamedCommand * KisLayer::setLockedCommand | ( | bool | locked | ) |
Definition at line 516 of file kis_layer.cpp.
◆ setName()
|
virtual |
Definition at line 526 of file kis_layer.cpp.
◆ setOpacity()
| void KisLayer::setOpacity | ( | TQ_UINT8 | val | ) |
Definition at line 445 of file kis_layer.cpp.
◆ setOpacityCommand() [1/2]
| KNamedCommand * KisLayer::setOpacityCommand | ( | TQ_UINT8 | prevOpacity, |
| TQ_UINT8 | newOpacity | ||
| ) |
Definition at line 460 of file kis_layer.cpp.
◆ setOpacityCommand() [2/2]
| KNamedCommand * KisLayer::setOpacityCommand | ( | TQ_UINT8 | val | ) |
Definition at line 455 of file kis_layer.cpp.
◆ setTemporary()
| void KisLayer::setTemporary | ( | bool | t | ) |
Definition at line 511 of file kis_layer.cpp.
◆ setVisible()
|
virtual |
Definition at line 470 of file kis_layer.cpp.
◆ setVisibleCommand()
| KNamedCommand * KisLayer::setVisibleCommand | ( | bool | visiblel | ) |
Definition at line 484 of file kis_layer.cpp.
◆ siblingAbove()
|
inline |
Returns the sibling above this layer in its parent's list.
0 is returned if there is no parent, or if this layer is the topmost layer in its group. This is the same as calling prevSibling().
Definition at line 121 of file kis_layer.h.
◆ siblingBelow()
|
inline |
Returns the sibling below this layer in its parent's list.
0 is returned if there is no parent, or if this layer is the bottommost layer in its group. This is the same as calling nextSibling().
Definition at line 127 of file kis_layer.h.
◆ temporary()
| bool KisLayer::temporary | ( | ) | const |
Definition at line 506 of file kis_layer.cpp.
◆ undoAdapter()
| KisUndoAdapter * KisLayer::undoAdapter | ( | ) | const |
Definition at line 556 of file kis_layer.cpp.
◆ visible()
|
virtual |
Definition at line 465 of file kis_layer.cpp.
Friends And Related Symbol Documentation
◆ KisGroupLayer
|
friend |
Definition at line 215 of file kis_layer.h.
The documentation for this class was generated from the following files:
