krita

KisImage Class Reference

List of all members.

Detailed Description

Definition at line 61 of file kis_image.h.


Public Types

enum  enumPaintFlags {
  PAINT_IMAGE_ONLY = 0, PAINT_BACKGROUND = 1, PAINT_SELECTION = 2, PAINT_MASKINACTIVELAYERS = 4,
  PAINT_EMBEDDED_RECT = 8
}
typedef enum KisImage::enumPaintFlags PaintFlags

Public Slots

void slotSelectionChanged ()
void slotSelectionChanged (const QRect &r)

Signals

void sigActiveSelectionChanged (KisImageSP image)
void sigSelectionChanged (KisImageSP image)
void sigSelectionChanged (KisImageSP image, const QRect &rect)
void sigLayerActivated (KisLayerSP layer)
void sigLayerAdded (KisLayerSP layer)
void sigLayerRemoved (KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP wasAboveThis)
void sigLayerMoved (KisLayerSP layer, KisGroupLayerSP previousParent, KisLayerSP wasAboveThis)
void sigLayerPropertiesChanged (KisLayerSP layer)
void sigLayersChanged (KisGroupLayerSP rootLayer)
void sigImageUpdated (QRect rc)
void sigLayerUpdated (KisLayerSP layer, QRect rc)
void sigImageModified ()
void sigSizeChanged (Q_INT32 w, Q_INT32 h)
void sigProfileChanged (KisProfile *profile)
void sigColorSpaceChanged (KisColorSpace *cs)
void sigMaskInfoChanged ()

Public Member Functions

 KisImage (KisUndoAdapter *adapter, Q_INT32 width, Q_INT32 height, KisColorSpace *colorSpace, const QString &name)
 KisImage (const KisImage &rhs)
virtual ~KisImage ()
virtual DCOPObject * dcopObject ()
virtual void renderToPainter (Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2, QPainter &painter, KisProfile *profile, PaintFlags paintFlags, float exposure=0.0f)
virtual QImage convertToQImage (Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2, KisProfile *profile, float exposure=0.0f)
virtual QImage convertToQImage (const QRect &r, const QSize &fullImageSize, KisProfile *profile, PaintFlags paintFlags, float exposure=0.0f)
KisBackgroundSP background () const
KisSubstrateSP substrate () const
void lock ()
void unlock ()
bool locked () const
KisColor backgroundColor () const
void setBackgroundColor (const KisColor &color)
QString name () const
void setName (const QString &name)
QString description () const
void setDescription (const QString &description)
QString nextLayerName () const
void rollBackLayerName ()
KisPerspectiveGridperspectiveGrid ()
void createPerspectiveGrid (QPoint topLeft, QPoint topRight, QPoint bottomRight, QPoint bottomLeft)
void resize (Q_INT32 w, Q_INT32 h, Q_INT32 x=0, Q_INT32 y=0, bool cropLayers=false)
void resize (const QRect &rc, bool cropLayers=false)
void scale (double sx, double sy, KisProgressDisplayInterface *m_progress, KisFilterStrategy *filterStrategy)
void rotate (double radians, KisProgressDisplayInterface *m_progress)
void shear (double angleX, double angleY, KisProgressDisplayInterface *m_progress)
void convertTo (KisColorSpace *dstColorSpace, Q_INT32 renderingIntent=INTENT_PERCEPTUAL)
KisProfilegetProfile () const
void setProfile (const KisProfile *profile)
void setUndoAdapter (KisUndoAdapter *undoAdapter)
KisUndoAdapterundoAdapter () const
bool undo () const
void setModified ()
KisColorSpacecolorSpace () const
double xRes ()
double yRes ()
void setResolution (double xres, double yres)
Q_INT32 width () const
Q_INT32 height () const
bool empty () const
KisPaintDeviceSP mergedImage ()
KisColor mergedPixel (Q_INT32 x, Q_INT32 y)
KisLayerSP newLayer (const QString &name, Q_UINT8 opacity, const KisCompositeOp &compositeOp=KisCompositeOp(), KisColorSpace *colorstrategy=0)
KisPaintDeviceSP activeDevice ()
void setLayerProperties (KisLayerSP layer, Q_UINT8 opacity, const KisCompositeOp &compositeOp, const QString &name)
KisGroupLayerSP rootLayer () const
KisLayerSP activeLayer () const
KisPaintDeviceSP projection ()
KisLayerSP activate (KisLayerSP layer)
KisLayerSP findLayer (const QString &name) const
KisLayerSP findLayer (int id) const
bool moveLayer (KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis)
bool addLayer (KisLayerSP layer, KisGroupLayerSP parent)
bool addLayer (KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP aboveThis)
bool removeLayer (KisLayerSP layer)
bool raiseLayer (KisLayerSP layer)
bool lowerLayer (KisLayerSP layer)
bool toTop (KisLayerSP layer)
bool toBottom (KisLayerSP layer)
Q_INT32 nlayers () const
Q_INT32 nHiddenLayers () const
KCommand * raiseLayerCommand (KisLayerSP layer)
KCommand * lowerLayerCommand (KisLayerSP layer)
KCommand * topLayerCommand (KisLayerSP layer)
KCommand * bottomLayerCommand (KisLayerSP layer)
void flatten ()
void mergeLayer (KisLayerSP l)
QRect bounds () const
void notifyLayersChanged ()
void notifyPropertyChanged (KisLayerSP layer)
void notifyImageLoaded ()
void notifyLayerUpdated (KisLayerSP layer, QRect rc)
void setColorSpace (KisColorSpace *colorSpace)
void setRootLayer (KisGroupLayerSP rootLayer)
void addAnnotation (KisAnnotationSP annotation)
KisAnnotationSP annotation (QString type)
void removeAnnotation (QString type)
vKisAnnotationSP_it beginAnnotations ()
vKisAnnotationSP_it endAnnotations ()

Member Function Documentation

void KisImage::renderToPainter ( Q_INT32  x1,
Q_INT32  y1,
Q_INT32  x2,
Q_INT32  y2,
QPainter &  painter,
KisProfile profile,
PaintFlags  paintFlags,
float  exposure = 0.0f 
) [virtual]

Paint the specified rect onto the painter, adjusting the colors using the given profile.

The exposure setting is used if the image has a high dynamic range.

Definition at line 1372 of file kis_image.cc.

QImage KisImage::convertToQImage ( Q_INT32  x1,
Q_INT32  y1,
Q_INT32  x2,
Q_INT32  y2,
KisProfile profile,
float  exposure = 0.0f 
) [virtual]

Render the projection onto a QImage.

In contrast with the above method, the selection is not rendered.

Definition at line 1408 of file kis_image.cc.

void KisImage::lock (  ) 

Lock the image to make sure no recompositing-causing signals get emitted while you're messing with the layers.

Don't forget to unlock again.

Definition at line 681 of file kis_image.cc.

void KisImage::unlock (  ) 

Unlock the image to make sure the rest of Krita learns about changes in the image again.

If the rootLayer is dirty on unlocking, an imgUpdated signal is sent out immediately.

Definition at line 691 of file kis_image.cc.

bool KisImage::locked (  )  const

Returns true if the image is locked.

Definition at line 676 of file kis_image.cc.

void KisImage::resize ( Q_INT32  w,
Q_INT32  h,
Q_INT32  x = 0,
Q_INT32  y = 0,
bool  cropLayers = false 
)

Resize the image to the specified width and height.

The resize method handles the creating on an undo step itself.

Parameters:
w the new width of the image
h the new height of the image
x the x position of the crop on all layer if cropLayers is true
y the y position of the crop on all layer if cropLayers is true
cropLayers if true, all layers are cropped to the new size.

Definition at line 729 of file kis_image.cc.

void KisImage::resize ( const QRect &  rc,
bool  cropLayers = false 
)

Resize the image to the specified width and height.

The resize method handles the creating on an undo step itself.

Parameters:
rc the rect describing the new width and height of the image
cropLayers if true, all layers are cropped to the new rect

Definition at line 764 of file kis_image.cc.

void KisImage::convertTo ( KisColorSpace dstColorSpace,
Q_INT32  renderingIntent = INTENT_PERCEPTUAL 
)

Convert the image and all its layers to the dstColorSpace.

Definition at line 909 of file kis_image.cc.

void KisImage::setProfile ( const KisProfile profile  ) 

Set the profile of the image to the new profile and do the same for all layers that have the same colorspace and profile as the image.

It doesn't do any pixel conversion.

This is essential if you have loaded an image that didn't have an embedded profile to which you want to attach the right profile.

Definition at line 948 of file kis_image.cc.

void KisImage::setUndoAdapter ( KisUndoAdapter undoAdapter  ) 

Replace the current undo adapter with the specified undo adapter.

The current undo adapter will _not_ be deleted.

Definition at line 1570 of file kis_image.cc.

KisUndoAdapter * KisImage::undoAdapter (  )  const

Returns the current undo adapter.

You can add new commands to the undo stack using the adapter

Definition at line 1576 of file kis_image.cc.

bool KisImage::undo (  )  const

Returns true if this image wants undo information, false otherwise.

Definition at line 1581 of file kis_image.cc.

void KisImage::setModified (  ) 

Tell the image it's modified; this emits the sigImageModified signal.

This happens when the image needs to be saved

Definition at line 1367 of file kis_image.cc.

KisPaintDeviceSP KisImage::mergedImage (  ) 

returns a paintdevice that contains the merged layers of this image, within the bounds of this image (with the colorspace and profile of this image)

Definition at line 1540 of file kis_image.cc.

KisLayerSP KisImage::newLayer ( const QString &  name,
Q_UINT8  opacity,
const KisCompositeOp compositeOp = KisCompositeOp(),
KisColorSpace colorstrategy = 0 
)

Creates a new paint layer with the specified properties, adds it to the image, and returns it.

Definition at line 1037 of file kis_image.cc.

KisPaintDeviceSP KisImage::activeDevice (  ) 

Get the active painting device. Returns 0 if the active layer does not have a paint device.

Definition at line 995 of file kis_image.cc.

KisPaintDeviceSP KisImage::projection (  ) 

Return the projection; that is, the complete, composited representation of this image.

Definition at line 1090 of file kis_image.cc.

bool KisImage::moveLayer ( KisLayerSP  layer,
KisGroupLayerSP  parent,
KisLayerSP  aboveThis 
)

Move layer to specified position.

Definition at line 1257 of file kis_image.cc.

bool KisImage::addLayer ( KisLayerSP  layer,
KisGroupLayerSP  parent 
)

Add an already existing layer to the image.

The layer is put on top of the layers in the specified layergroup

Parameters:
layer the layer to be added
parent the parent layer

Definition at line 1119 of file kis_image.cc.

bool KisImage::addLayer ( KisLayerSP  layer,
KisGroupLayerSP  parent,
KisLayerSP  aboveThis 
)

Add already existing layer to image.

Parameters:
layer the layer to be added
parent the parent layer
aboveThis in the list with child layers of the specified parent, add this layer above the specified sibling. if 0, the layer is put in the lowermost position in its group.
notify If true, the image is immediately recomposited, if false, no recomposition is done yet. The added layer is all
returns false if adding the layer didn't work, true if the layer got added

Definition at line 1124 of file kis_image.cc.

bool KisImage::removeLayer ( KisLayerSP  layer  ) 

Remove layer.

Definition at line 1161 of file kis_image.cc.

bool KisImage::raiseLayer ( KisLayerSP  layer  ) 

Move layer up one slot.

Definition at line 1227 of file kis_image.cc.

bool KisImage::lowerLayer ( KisLayerSP  layer  ) 

Move layer down one slot.

Definition at line 1234 of file kis_image.cc.

bool KisImage::toTop ( KisLayerSP  layer  ) 

Move layer to top slot.

Definition at line 1243 of file kis_image.cc.

bool KisImage::toBottom ( KisLayerSP  layer  ) 

Move layer to bottom slot.

Definition at line 1250 of file kis_image.cc.

void KisImage::flatten (  ) 

Merge all visible layers and discard hidden ones.

The resulting layer will be activated.

Definition at line 1307 of file kis_image.cc.

void KisImage::mergeLayer ( KisLayerSP  l  ) 

Merge the specified layer with the layer below this layer, remove the specified layer.

Definition at line 1345 of file kis_image.cc.

void KisImage::notifyLayersChanged (  ) 

use if the layers have changed _completely_ (eg. when flattening)

Definition at line 1550 of file kis_image.cc.

void KisImage::addAnnotation ( KisAnnotationSP  annotation  ) 

Add an annotation for this image.

This can be anything: Gamma, EXIF, etc. Note that the "icc" annotation is reserved for the colour strategies. If the annotation already exists, overwrite it with this one.

Definition at line 1632 of file kis_image.cc.

KisAnnotationSP KisImage::annotation ( QString  type  ) 

get the annotation with the given type, can return 0

Definition at line 1646 of file kis_image.cc.

void KisImage::removeAnnotation ( QString  type  ) 

delete the annotation, if the image contains it

Definition at line 1658 of file kis_image.cc.

vKisAnnotationSP_it KisImage::beginAnnotations (  ) 

Start of an iteration over the annotations of this image (including the ICC Profile).

Definition at line 1670 of file kis_image.cc.

vKisAnnotationSP_it KisImage::endAnnotations (  ) 

end of an iteration over the annotations of this image

Definition at line 1686 of file kis_image.cc.

void KisImage::sigLayerActivated ( KisLayerSP  layer  )  [signal]

Emitted after a different layer is made active.

void KisImage::sigLayerAdded ( KisLayerSP  layer  )  [signal]

Emitted after a layer is added: you can find out where by asking it for its parent(), et al.

void KisImage::sigLayerRemoved ( KisLayerSP  layer,
KisGroupLayerSP  wasParent,
KisLayerSP  wasAboveThis 
) [signal]

Emitted after a layer is removed.

It's no longer in the image, but still exists, so layer is valid.

Parameters:
layer the removed layer
parent the parent of the layer, before it was removed
wasAboveThis the layer it was above, before it was removed.

void KisImage::sigLayerMoved ( KisLayerSP  layer,
KisGroupLayerSP  previousParent,
KisLayerSP  wasAboveThis 
) [signal]

Emitted after a layer is moved to a different position under its parent layer, or its parent changes.

Parameters:
previousParent the parent of the layer, before it was moved
wasAboveThis the layer it was above, before it was moved.

void KisImage::sigLayerPropertiesChanged ( KisLayerSP  layer  )  [signal]

Emitted after a layer's properties (visible, locked, opacity, composite op, name, ...) change.

void KisImage::sigLayersChanged ( KisGroupLayerSP  rootLayer  )  [signal]

Emitted when the list of layers has changed completely.

This means e.g. when the image is flattened, but not when it is rotated, as the layers only change internally then.

void KisImage::sigImageUpdated ( QRect  rc  )  [signal]

Emitted whenever an action has caused the image to be recomposited.

This happens after calls to recomposite().

Parameters:
rc The rect that has been recomposited.

void KisImage::sigLayerUpdated ( KisLayerSP  layer,
QRect  rc 
) [signal]

Emitted whenever a layer is modified.

Parameters:
layer The layer that has been modified.
rc The rectangle that has been modified.

void KisImage::sigImageModified (  )  [signal]

Emitted whenever the image has been modified, so that it doesn't match with the version saved on disk.

void KisImage::sigMaskInfoChanged (  )  [signal]

Emitted when any layer's mask info got updated (or when the current layer changes).


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys