chalk

kis_adjustment_layer.h
1/*
2 * Copyright (c) 2006 Boudewijn Rempt
3 *
4 * this program is free software; you can redistribute it and/or modify
5 * it under the terms of the gnu general public license as published by
6 * the free software foundation; either version 2 of the license, or
7 * (at your option) any later version.
8 *
9 * this program is distributed in the hope that it will be useful,
10 * but without any warranty; without even the implied warranty of
11 * merchantability or fitness for a particular purpose. see the
12 * gnu general public license for more details.
13 *
14 * you should have received a copy of the gnu general public license
15 * along with this program; if not, write to the free software
16 * foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
17 */
18#ifndef KIS_ADJUSTMENT_LAYER_H_
19#define KIS_ADJUSTMENT_LAYER_H_
20
21#include <tqobject.h>
22#include "kis_types.h"
23#include "kis_layer_visitor.h"
24#include "kis_composite_op.h"
25#include <koffice_export.h>
26
27class KNamedCommand;
28class TQPainter;
29class KisUndoAdapter;
30class KisGroupLayer;
32
38class KRITACORE_EXPORT KisAdjustmentLayer : public KisLayer, public KisLayerSupportsIndirectPainting
39{
40 TQ_OBJECT
41
42
43public:
48 KisAdjustmentLayer(KisImageSP img, const TQString &name, KisFilterConfiguration * kfc, KisSelectionSP selection);
50 virtual ~KisAdjustmentLayer();
51
53 virtual KisLayerSP clone() const;
54
55public:
56
57 KisFilterConfiguration * filter();
58 void setFilter(KisFilterConfiguration * filterConfig);
59
60 KisSelectionSP selection();
61
63 void setSelection(KisSelectionSP selection);
64
66 void clearSelection();
67
68 virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h);
69 virtual void paintSelection(TQImage &img, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize);
70public:
71
72 virtual TQ_INT32 x() const;
73 virtual void setX(TQ_INT32);
74
75 virtual TQ_INT32 y() const;
76 virtual void setY(TQ_INT32);
77
79 virtual TQRect extent() const;
80
82 virtual TQRect exactBounds() const;
83
84 virtual bool accept(KisLayerVisitor &);
85
86 virtual void resetCache();
87 virtual KisPaintDeviceSP cachedPaintDevice() { return m_cachedPaintDev; }
88
89 bool showSelection() const { return m_showSelection; }
90 void setSelection(bool b) { m_showSelection = b; }
91
92 virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h);
93
94 // KisLayerSupportsIndirectPainting
95 virtual KisLayer* layer() { return this; }
96private:
97 bool m_showSelection;
98 KisFilterConfiguration * m_filterConfig;
99 KisSelectionSP m_selection;
100 KisPaintDeviceSP m_cachedPaintDev;
101private slots:
102 void slotSelectionChanged(KisImageSP image);
103};
104
105#endif // KIS_ADJUSTMENT_LAYER_H_
106
Class that contains a KisFilter and optionally a KisSelection.
A KisFilterConfiguration is the serializable representation of the filter parameters.
A KisLayer that bundles child layers into a single layer.
Abstract class that represents the concept of a Layer in Chalk.
Definition kis_layer.h:42
virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h)
Returns a thumbnail in requested size.
virtual KisLayerSP clone() const =0
Return a copy of this layer.
virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
paints a mask where the selection on this layer resides
virtual bool accept(KisLayerVisitor &)=0
Accept the KisLayerVisitor (for the Visitor design pattern), should call the correct function on the ...
virtual TQRect extent() const =0
Returns an approximation of where the bounds on actual data are in this layer.
virtual TQRect exactBounds() const =0
Returns the exact bounds of where the actual data resides in this layer.