24#include <tqvaluevector.h>
29#include <ksharedptr.h>
34#include "kis_composite_op.h"
35#include "kis_global.h"
37#include "kis_annotation.h"
38#include "kis_paint_device.h"
40#include <koffice_export.h>
46class KoCommandHistory;
54class KisFilterStrategy;
57class KisProgressDisplayInterface;
59class KisPerspectiveGrid;
61class KRITACORE_EXPORT KisImage :
public TQObject,
public TDEShared {
66 KisImage(KisUndoAdapter * adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace,
const TQString& name);
67 KisImage(
const KisImage& rhs);
69 virtual DCOPObject *dcopObject();
72 typedef enum enumPaintFlags {
76 PAINT_MASKINACTIVELAYERS = 4,
77 PAINT_EMBEDDED_RECT = 8
82 virtual void renderToPainter(TQ_INT32 x1,
88 PaintFlags paintFlags,
89 float exposure = 0.0f);
94 virtual TQImage convertToTQImage(TQ_INT32 x1,
99 float exposure = 0.0f);
101 virtual TQImage convertToTQImage(
const TQRect& r,
const TQSize& fullImageSize, KisProfile *profile, PaintFlags paintFlags,
float exposure = 0.0f);
103 KisBackgroundSP background()
const;
104 KisSubstrateSP substrate()
const;
127 KisColor backgroundColor()
const;
128 void setBackgroundColor(
const KisColor & color);
130 TQString name()
const;
131 void setName(
const TQString& name);
133 TQString description()
const;
134 void setDescription(
const TQString& description);
136 TQString nextLayerName()
const;
137 void rollBackLayerName();
139 KisPerspectiveGrid* perspectiveGrid();
140 void createPerspectiveGrid(TQPoint topLeft, TQPoint topRight, TQPoint bottomRight, TQPoint bottomLeft);
151 void resize(TQ_INT32 w, TQ_INT32 h, TQ_INT32 x = 0, TQ_INT32 y = 0,
bool cropLayers =
false);
160 void resize(
const TQRect& rc,
bool cropLayers =
false);
162 void scale(
double sx,
double sy, KisProgressDisplayInterface *m_progress, KisFilterStrategy *filterStrategy);
163 void rotate(
double radians, KisProgressDisplayInterface *m_progress);
164 void shear(
double angleX,
double angleY, KisProgressDisplayInterface *m_progress);
169 void convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent = INTENT_PERCEPTUAL);
172 KisProfile * getProfile()
const;
183 void setProfile(
const KisProfile * profile);
189 void setUndoAdapter(KisUndoAdapter * undoAdapter);
195 KisUndoAdapter *undoAdapter()
const;
207 KisColorSpace * colorSpace()
const;
212 void setResolution(
double xres,
double yres);
214 TQ_INT32 width()
const;
215 TQ_INT32 height()
const;
223 KisPaintDeviceSP mergedImage();
228 KisColor mergedPixel(TQ_INT32 x, TQ_INT32 y);
231 KisLayerSP newLayer(
const TQString& name, TQ_UINT8 opacity,
232 const KisCompositeOp& compositeOp = KisCompositeOp(), KisColorSpace * colorstrategy = 0);
235 KisPaintDeviceSP activeDevice();
237 void setLayerProperties(KisLayerSP layer, TQ_UINT8 opacity,
const KisCompositeOp& compositeOp,
const TQString& name);
239 KisGroupLayerSP rootLayer()
const;
240 KisLayerSP activeLayer()
const;
244 KisPaintDeviceSP projection();
246 KisLayerSP activate(KisLayerSP layer);
247 KisLayerSP findLayer(
const TQString& name)
const;
248 KisLayerSP findLayer(
int id)
const;
251 bool moveLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis);
259 bool addLayer(KisLayerSP layer, KisGroupLayerSP parent);
275 bool addLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis);
278 bool removeLayer(KisLayerSP layer);
281 bool raiseLayer(KisLayerSP layer);
284 bool lowerLayer(KisLayerSP layer);
287 bool toTop(KisLayerSP layer);
290 bool toBottom(KisLayerSP layer);
292 TQ_INT32 nlayers()
const;
293 TQ_INT32 nHiddenLayers()
const;
295 KCommand *raiseLayerCommand(KisLayerSP layer);
296 KCommand *lowerLayerCommand(KisLayerSP layer);
297 KCommand *topLayerCommand(KisLayerSP layer);
298 KCommand *bottomLayerCommand(KisLayerSP layer);
310 void mergeLayer(KisLayerSP l);
312 TQRect bounds()
const;
315 void notifyLayersChanged();
317 void notifyPropertyChanged(KisLayerSP layer);
319 void notifyImageLoaded();
321 void notifyLayerUpdated(KisLayerSP layer, TQRect rc);
323 void setColorSpace(KisColorSpace * colorSpace);
324 void setRootLayer(KisGroupLayerSP rootLayer);
333 void addAnnotation(KisAnnotationSP annotation);
336 KisAnnotationSP annotation(TQString type);
339 void removeAnnotation(TQString type);
344 vKisAnnotationSP_it beginAnnotations();
347 vKisAnnotationSP_it endAnnotations();
351 void sigActiveSelectionChanged(KisImageSP image);
352 void sigSelectionChanged(KisImageSP image);
353 void sigSelectionChanged(KisImageSP image,
const TQRect& rect);
356 void sigLayerActivated(KisLayerSP layer);
359 void sigLayerAdded(KisLayerSP layer);
368 void sigLayerRemoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP wasAboveThis);
375 void sigLayerMoved(KisLayerSP layer, KisGroupLayerSP previousParent, KisLayerSP wasAboveThis);
378 void sigLayerPropertiesChanged(KisLayerSP layer);
384 void sigLayersChanged(KisGroupLayerSP rootLayer);
392 void sigImageUpdated(TQRect rc);
400 void sigLayerUpdated(KisLayerSP layer, TQRect rc);
405 void sigImageModified();
407 void sigSizeChanged(TQ_INT32 w, TQ_INT32 h);
408 void sigProfileChanged(KisProfile * profile);
409 void sigColorSpaceChanged(KisColorSpace* cs);
413 void sigMaskInfoChanged();
415 void slotSelectionChanged();
416 void slotSelectionChanged(
const TQRect& r);
420 KisImage& operator=(
const KisImage& rhs);
421 void init(KisUndoAdapter * adapter, TQ_INT32 width, TQ_INT32 height, KisColorSpace * colorSpace,
const TQString& name);
422 void emitSizeChanged();
428 TQString m_description;
438 KisColorSpace * m_colorSpace;
443 KisBackgroundSP m_bkg;
445 KisGroupLayerSP m_rootLayer;
446 KisLayerSP m_activeLayer;
448 KisNameServer *m_nserver;
449 KisUndoAdapter *m_adapter;
454 vKisAnnotationSP m_annotations;
456 class KisImagePrivate;
457 KisImagePrivate * m_private;
A colorspace is the definition of a certain color model in Chalk.
A KisColor describes a color in a certain colorspace.
This layer is of a type that can be painted on.
KisPainter contains the graphics primitives necessary to draw on a KisPaintDevice.