krita
KisPaintDevice Class Reference
#include <kis_paint_device.h>
Inheritance diagram for KisPaintDevice:

Detailed Description
A paint device contains the actual pixel data and offers methods to read and write pixels.A paint device has an integer x,y position (i.e., are not positioned on the image with sub-pixel accuracy). A KisPaintDevice doesn't have any fixed size, the size change dynamicaly when pixels are accessed by an iterator.
Definition at line 71 of file kis_paint_device.h.
Signals | |
void | positionChanged (KisPaintDeviceSP device) |
void | ioProgress (Q_INT8 percentage) |
void | profileChanged (KisProfile *profile) |
Public Member Functions | |
KisPaintDevice (KisColorSpace *colorSpace, const char *name=0) | |
KisPaintDevice (KisLayer *parentLayer, KisColorSpace *colorSpace, const char *name=0) | |
KisPaintDevice (const KisPaintDevice &rhs) | |
virtual | ~KisPaintDevice () |
virtual DCOPObject * | dcopObject () |
virtual bool | write (KoStore *store) |
virtual bool | read (KoStore *store) |
virtual void | move (Q_INT32 x, Q_INT32 y) |
virtual void | move (const QPoint &pt) |
virtual KNamedCommand * | moveCommand (Q_INT32 x, Q_INT32 y) |
bool | contains (Q_INT32 x, Q_INT32 y) const |
bool | contains (const QPoint &pt) const |
void | extent (Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const |
virtual QRect | extent () const |
bool | extentIsValid () const |
void | setExtentIsValid (bool isValid) |
void | exactBounds (Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const |
virtual QRect | exactBounds () const |
void | crop (Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
void | crop (QRect r) |
virtual void | clear () |
void | fill (Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *fillPixel) |
virtual void | readBytes (Q_UINT8 *data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
virtual void | writeBytes (const Q_UINT8 *data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
Q_INT32 | numContiguousColumns (Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) |
Q_INT32 | numContiguousRows (Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) |
Q_INT32 | rowStride (Q_INT32 x, Q_INT32 y) |
const Q_UINT8 * | pixel (Q_INT32 x, Q_INT32 y) |
Q_UINT8 * | writablePixel (Q_INT32 x, Q_INT32 y) |
virtual void | convertTo (KisColorSpace *dstColorSpace, Q_INT32 renderingIntent=INTENT_PERCEPTUAL) |
virtual void | setProfile (KisProfile *profile) |
virtual void | convertFromQImage (const QImage &img, const QString &srcProfileName, Q_INT32 offsetX=0, Q_INT32 offsetY=0) |
virtual QImage | convertToQImage (KisProfile *dstProfile, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, float exposure=0.0f) |
virtual QImage | convertToQImage (KisProfile *dstProfile, float exposure=0.0f) |
KisPaintDeviceSP | createThumbnailDevice (Q_INT32 w, Q_INT32 h) |
virtual QImage | createThumbnail (Q_INT32 maxw, Q_INT32 maxh) |
bool | pixel (Q_INT32 x, Q_INT32 y, QColor *c, Q_UINT8 *opacity) |
bool | pixel (Q_INT32 x, Q_INT32 y, KisColor *kc) |
KisColor | colorAt (Q_INT32 x, Q_INT32 y) |
bool | setPixel (Q_INT32 x, Q_INT32 y, const QColor &c, Q_UINT8 opacity) |
bool | setPixel (Q_INT32 x, Q_INT32 y, const KisColor &kc) |
KisColorSpace * | colorSpace () const |
KisDataManagerSP | dataManager () const |
void | setData (KisDataManagerSP data, KisColorSpace *colorSpace) |
Q_INT32 | getX () const |
Q_INT32 | getY () const |
void | setX (Q_INT32 x) |
void | setY (Q_INT32 y) |
virtual Q_INT32 | pixelSize () const |
virtual Q_INT32 | nChannels () const |
KisImage * | image () const |
KisLayer * | parentLayer () const |
void | setParentLayer (KisLayer *parentLayer) |
void | setDirty (const QRect &rc) |
void | setDirty () |
void | mirrorX () |
void | mirrorY () |
KisMementoSP | getMemento () |
void | rollback (KisMementoSP memento) |
void | rollforward (KisMementoSP memento) |
KisRectIteratorPixel | createRectIterator (Q_INT32 left, Q_INT32 top, Q_INT32 w, Q_INT32 h, bool writable) |
KisHLineIteratorPixel | createHLineIterator (Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable) |
KisVLineIteratorPixel | createVLineIterator (Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable) |
KisSelectionSP | selection () |
void | addSelection (KisSelectionSP selection) |
void | subtractSelection (KisSelectionSP selection) |
bool | hasSelection () |
bool | selectionDeselected () |
void | deselect () |
void | reselect () |
void | clearSelection () |
void | applySelectionMask (KisSelectionSP mask) |
KisSelectionSP | setSelection (KisSelectionSP selection) |
void | emitSelectionChanged () |
void | emitSelectionChanged (const QRect &r) |
KisUndoAdapter * | undoAdapter () const |
KisExifInfo * | exifInfo () |
bool | hasExifInfo () |
Protected Attributes | |
KisDataManagerSP | m_datamanager |
Constructor & Destructor Documentation
|
Create a new paint device with the specified colorspace.
Definition at line 200 of file kis_paint_device.cc. |
|
Create a new paint device with the specified colorspace. The parentLayer will be notified of changes to this paint device.
Definition at line 241 of file kis_paint_device.cc. |
Member Function Documentation
|
Adds the specified selection to the currently active selection for this paintdevice.
Definition at line 948 of file kis_paint_device.cc. |
|
Apply a mask to the image data, i.e. multiply each pixel's opacity by its selectedness in the mask. Definition at line 996 of file kis_paint_device.cc. |
|
Complete erase the current paint device. Its size will become 0. Reimplemented in KisSelection. Definition at line 526 of file kis_paint_device.cc. |
|
Clear the selected pixels from the paint device.
Definition at line 967 of file kis_paint_device.cc. |
|
Return the KisColor of the pixel at x,y.
Definition at line 1055 of file kis_paint_device.cc. |
|
Convenience method for the above.
|
|
Returns true of x,y is within the extent of this paint device.
|
|
Fill this paint device with the data from img; starting at (offsetX, offsetY).
Definition at line 703 of file kis_paint_device.cc. |
|
Converts the paint device to a different colorspace.
Definition at line 621 of file kis_paint_device.cc. |
|
Create an RGBA QImage from a rectangle in the paint device. The rectangle is defined by the parent image's bounds.
Definition at line 730 of file kis_paint_device.cc. |
|
Create an RGBA QImage from a rectangle in the paint device.
Definition at line 752 of file kis_paint_device.cc. |
|
This function return an iterator which points to the first pixel of a horizontal line.
Definition at line 875 of file kis_paint_device.cc. |
|
This function return an iterator which points to the first pixel of an rectangle.
Definition at line 867 of file kis_paint_device.cc. |
|
Creates a thumbnail of the paint device, retaining the aspect ratio.
The width and height of the returned QImage won't exceed Definition at line 819 of file kis_paint_device.cc. |
|
Creates a paint device thumbnail of the paint device, retaining the aspect ratio.
The width and height of the returned device won't exceed Definition at line 772 of file kis_paint_device.cc. |
|
This function return an iterator which points to the first pixel of a vertical line.
Definition at line 883 of file kis_paint_device.cc. |
|
Convience method for the above.
Definition at line 521 of file kis_paint_device.cc. |
|
Cut the paint device down to the specified rect.
Definition at line 515 of file kis_paint_device.cc. |
|
Deselect the selection for this paintdevice.
Definition at line 934 of file kis_paint_device.cc. |
|
Notify the owning image that the current selection has changed.
Definition at line 899 of file kis_paint_device.cc. |
|
Notify the owning image that the current selection has changed.
Definition at line 892 of file kis_paint_device.cc. |
|
Get the exact bounds of this paint device. This may be very slow, especially on larger paint devices because it does a linear scanline search. Definition at line 428 of file kis_paint_device.cc. |
|
Return the exifInfo associated with this layer. If no exif infos are available, the function will create it. Definition at line 1143 of file kis_paint_device.cc. |
|
Retrieve the bounds of the paint device. The size is not exact, but may be larger if the underlying datamanager works that way. For instance, the tiled datamanager keeps the extent to the nearest multiple of 64. Definition at line 404 of file kis_paint_device.cc. |
|
XXX: This should be a temporay hack, awaiting a proper fix. Indicates whether the extent really represents the extent. For example, the KisBackground checkerboard pattern is generated by filling the default tile but it will return an empty extent. Definition at line 418 of file kis_paint_device.cc. |
|
Fill the given rectangle with the given pixel.
Definition at line 531 of file kis_paint_device.cc. |
|
The X offset of the paint device.
Definition at line 566 of file kis_paint_device.h. |
|
The Y offset of the paint device.
Definition at line 571 of file kis_paint_device.h. |
|
This function return true if the layer has exif info associated with it.
Definition at line 499 of file kis_paint_device.h. |
|
Whether there is a valid selection for this paintdevice.
Definition at line 923 of file kis_paint_device.cc. |
|
Return the image that contains this paint device, or 0 if it is not part of an image. This is the same as calling parentLayer()->image(). Definition at line 361 of file kis_paint_device.cc. |
|
Mirror the device along the X axis.
Definition at line 536 of file kis_paint_device.cc. |
|
Mirror the device along the Y axis.
Definition at line 566 of file kis_paint_device.cc. |
|
Convenience method for the above.
Definition at line 391 of file kis_paint_device.cc. |
|
Moves the device to these new coordinates (so no incremental move or so).
Definition at line 371 of file kis_paint_device.cc. |
|
Move the paint device to the specified location and make it possible to undo the move.
Definition at line 396 of file kis_paint_device.cc. |
|
Return the number of channels a pixel takes.
Definition at line 552 of file kis_paint_device.h. |
|
Get the number of contiguous columns starting at x, valid for all values of y between minY and maxY.
Definition at line 1087 of file kis_paint_device.cc. |
|
Get the number of contiguous rows starting at y, valid for all values of x between minX and maxX.
Definition at line 1092 of file kis_paint_device.cc. |
|
Returns the KisLayer that contains this paint device, or 0 if this is not part of a layer.
Definition at line 341 of file kis_paint_device.cc. |
|
Fill kc with the values found at x and y. This method differs from the above in using KisColor, which can be of any colorspace The color values will be transformed from the profile of this paint device to the display profile.
Definition at line 1042 of file kis_paint_device.cc. |
|
Fill c and opacity with the values found at x and y. The color values will be transformed from the profile of this paint device to the display profile.
Definition at line 1028 of file kis_paint_device.cc. |
|
Get a read-only pointer to pixel (x, y).
Definition at line 1102 of file kis_paint_device.cc. |
|
Return the number of bytes a pixel takes.
Definition at line 546 of file kis_paint_device.h. |
|
Fill this paint device with the pixels from the specified file store.
Definition at line 613 of file kis_paint_device.cc. |
|
Read the bytes representing the rectangle described by x, y, w, h into data. If data is not big enough, Krita will gladly overwrite the rest of your precious memory. Since this is a copy, you need to make sure you have enough memory. Reading from areas not previously initialized will read the default pixel value into data but not initialize that region. Definition at line 1127 of file kis_paint_device.cc. |
|
Reinstates the old selection.
Definition at line 942 of file kis_paint_device.cc. |
|
Get the row stride at pixel (x, y). This is the number of bytes to add to a pointer to pixel (x, y) to access (x, y + 1). Definition at line 1097 of file kis_paint_device.cc. |
|
Get the current selection or create one if this paintdevice hasn't got a selection yet.
Definition at line 906 of file kis_paint_device.cc. |
|
Whether the previous selection was deselected.
Definition at line 928 of file kis_paint_device.cc. |
|
Replace the pixel data, color strategy, and profile.
Definition at line 682 of file kis_paint_device.cc. |
|
Set the parent layer completely dirty, if this paint device has one.
Definition at line 356 of file kis_paint_device.cc. |
|
Add the specified rect top the parent layer (if present).
Definition at line 351 of file kis_paint_device.cc. |
|
Convience method for the above.
Definition at line 423 of file kis_paint_device.cc. |
|
Set the KisLayer that contains this paint device, or 0 if this is not part of a layer.
Definition at line 346 of file kis_paint_device.cc. |
|
Set the specified pixel to the specified color. Note that this bypasses KisPainter. the PaintDevice is here used as an equivalent to QImage, not QPixmap. This means that this is not undoable; also, there is no compositing with an existing value at this location. The color values will be transformed from the display profile to the paint device profile. Note that this will use 8-bit values and may cause a significant degradation when used on 16-bit or hdr quality images.
Definition at line 1060 of file kis_paint_device.cc. |
|
Changes the profile of the colorspace of this paint device to the given profile. If the given profile is 0, nothing happens. Definition at line 670 of file kis_paint_device.cc. |
|
Sets the selection of this paint device to the new selection, returns the old selection, if there was an old selection, otherwise 0.
Definition at line 1017 of file kis_paint_device.cc. |
|
Return the X offset of the paint device.
Definition at line 1112 of file kis_paint_device.cc. |
|
Return the Y offset of the paint device.
Definition at line 1119 of file kis_paint_device.cc. |
|
Subtracts the specified selection from the currently active selection for this paindevice.
Definition at line 956 of file kis_paint_device.cc. |
|
Get a read-write pointer to pixel (x, y).
Definition at line 1107 of file kis_paint_device.cc. |
|
Write the pixels of this paint device into the specified file store.
Definition at line 605 of file kis_paint_device.cc. |
|
Copy the bytes in data into the rect specified by x, y, w, h. If the data is too small or uninitialized, Krita will happily read parts of memory you never wanted to be read. If the data is written to areas of the paint device not previously initialized, the paint device will grow. Definition at line 1132 of file kis_paint_device.cc. |
The documentation for this class was generated from the following files: