kis_paint_device.cpp
76 KisPaintDeviceCommand::KisPaintDeviceCommand(const TQString& name, KisPaintDeviceSP paintDevice) :
109 MoveCommand::MoveCommand(KisPaintDeviceSP device, const TQPoint& oldpos, const TQPoint& newpos) :
239KisPaintDevice::KisPaintDevice(KisLayer *parent, KisColorSpace * colorSpace, const char * name) :
562 KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(x, boundY2, boundH2, false);
582 KisVLineIterator it = const_cast<KisPaintDevice *>(this)->createVLineIterator(/*x + w*/ x2, boundY2, boundH2, false);
626void KisPaintDevice::fill(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel)
818 if (colorSpace() == KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KisID("RGBA",""),"")) {
853TQImage KisPaintDevice::convertToTQImage(KisProfile * dstProfile, TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 w, TQ_INT32 h, float exposure)
867 TQImage image = colorSpace()->convertToTQImage(data, w, h, dstProfile, INTENT_PERCEPTUAL, exposure);
969KisRectIteratorPixel KisPaintDevice::createRectIterator(TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable)
977KisHLineIteratorPixel KisPaintDevice::createHLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable)
980 return KisHLineIteratorPixel(this, m_datamanager, m_selection->m_datamanager, x, y, w, m_x, m_y, writable);
985KisVLineIteratorPixel KisPaintDevice::createVLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable)
994KisRandomAccessorPixel KisPaintDevice::createRandomAccessor(TQ_INT32 x, TQ_INT32 y, bool writable) {
1248void KisPaintDevice::writeBytes(const TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
KisColorSpace * getColorSpace(const KisID &csID, const TQString &profileName)
Return the colorspace + profile as named, or NULL if impossible combination.
Definition kis_colorspace_factory_registry.cpp:147
A colorspace is the definition of a certain color model in Chalk.
Definition kis_colorspace.h:58
virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, KisProfile *profile=0)=0
The toTQColor methods take a byte array that is at least pixelSize() long and converts the contents t...
virtual void applyAlphaU8Mask(TQ_UINT8 *pixels, TQ_UINT8 *alpha, TQ_INT32 nPixels)=0
Applies the specified 8-bit alpha mask to the pixels.
virtual void fromTQColor(const TQColor &c, TQ_UINT8 *dst, KisProfile *profile=0)=0
The fromTQColor methods take a given color defined as an RGB TQColor and fills a byte array with the ...
virtual TQValueList< KisFilter * > createBackgroundFilters()
The backgroundfilters will be run periodically on the newly created paint device.
Definition kis_colorspace.h:415
virtual bool convertPixelsTo(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorSpace *dstColorSpace, TQ_UINT32 numPixels, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL)=0
Convert a byte array of srcLen pixels *src to the specified color space and put the converted bytes i...
virtual TQImage convertToTQImage(const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, KisProfile *dstProfile, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL, float exposure=0.0f)=0
Convert the pixels in data to (8-bit BGRA) TQImage using the specified profiles.
virtual TQ_UINT32 pixelSize() const =0
The size in bytes of a single pixel in this color model.
virtual void applyInverseAlphaU8Mask(TQ_UINT8 *pixels, TQ_UINT8 *alpha, TQ_INT32 nPixels)=0
Applies the inverted 8-bit alpha mask to the pixels.
virtual TQ_UINT32 nChannels() const =0
The total number of channels for a single pixel in this color model.
virtual KisID id() const =0
Chalk definition for use in .kra files and internally: unchanging name + i18n'able description.
void setColor(TQ_UINT8 *data, KisColorSpace *colorSpace=0)
Replace the existing color data, and colorspace with the specified data.
Definition kis_color.cpp:123
KisDataManager defines the interface that modules responsible for storing and retrieving data must in...
Definition kis_datamanager.h:45
The pixel iterators are high level iterarators.
Definition kis_iterators_pixel.h:33
virtual void setDirty(bool propagate=true)
Set the entire layer extent dirty; this percolates up to parent layers all the way to the root layer.
Definition kis_layer.cpp:338
A paint device contains the actual pixel data and offers methods to read and write pixels.
Definition kis_paint_device.h:76
KisImage * image() const
Return the image that contains this paint device, or 0 if it is not part of an image.
Definition kis_paint_device.cpp:366
virtual TQImage convertToTQImage(KisProfile *dstProfile, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, float exposure=0.0f)
Create an RGBA TQImage from a rectangle in the paint device.
Definition kis_paint_device.cpp:853
KisRandomSubAccessorPixel createRandomSubAccessor()
This function create a random accessor which can easily access to sub pixel values.
Definition kis_paint_device.cpp:1001
KisRectIteratorPixel createRectIterator(TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable)
This function return an iterator which points to the first pixel of an rectangle.
Definition kis_paint_device.cpp:969
KisPaintDevice(KisColorSpace *colorSpace, const char *name=0)
Create a new paint device with the specified colorspace.
Definition kis_paint_device.cpp:204
TQ_INT32 rowStride(TQ_INT32 x, TQ_INT32 y)
Get the row stride at pixel (x, y).
Definition kis_paint_device.cpp:1213
virtual void writeBytes(const TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
Copy the bytes in data into the rect specified by x, y, w, h.
Definition kis_paint_device.cpp:1248
KisVLineIteratorPixel createVLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable)
This function return an iterator which points to the first pixel of a vertical line.
Definition kis_paint_device.cpp:985
virtual bool read(KoStore *store)
Fill this paint device with the pixels from the specified file store.
Definition kis_paint_device.cpp:708
KisLayer * parentLayer() const
Returns the KisLayer that contains this paint device, or 0 if this is not part of a layer.
Definition kis_paint_device.cpp:346
TDE_DEPRECATED const TQ_UINT8 * pixel(TQ_INT32 x, TQ_INT32 y)
Get a read-only pointer to pixel (x, y).
Definition kis_paint_device.cpp:1218
virtual void readBytes(TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
Read the bytes representing the rectangle described by x, y, w, h into data.
Definition kis_paint_device.cpp:1243
virtual void setProfile(KisProfile *profile)
Changes the profile of the colorspace of this paint device to the given profile.
Definition kis_paint_device.cpp:771
KisColor colorAt(TQ_INT32 x, TQ_INT32 y)
Return the KisColor of the pixel at x,y.
Definition kis_paint_device.cpp:1169
KisExifInfo * exifInfo()
Return the exifInfo associated with this layer.
Definition kis_paint_device.cpp:1259
KisSelectionSP selection()
Get the current selection or create one if this paintdevice hasn't got a selection yet.
Definition kis_paint_device.cpp:1020
void setParentLayer(KisLayer *parentLayer)
Set the KisLayer that contains this paint device, or 0 if this is not part of a layer.
Definition kis_paint_device.cpp:351
void clearSelection()
Clear the selected pixels from the paint device.
Definition kis_paint_device.cpp:1081
void addSelection(KisSelectionSP selection)
Adds the specified selection to the currently active selection for this paintdevice.
Definition kis_paint_device.cpp:1062
bool selectionDeselected()
Whether the previous selection was deselected.
Definition kis_paint_device.cpp:1042
virtual void convertTo(KisColorSpace *dstColorSpace, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL)
Converts the paint device to a different colorspace.
Definition kis_paint_device.cpp:716
TQ_INT32 numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX)
Get the number of contiguous rows starting at y, valid for all values of x between minX and maxX.
Definition kis_paint_device.cpp:1208
virtual KNamedCommand * moveCommand(TQ_INT32 x, TQ_INT32 y)
Move the paint device to the specified location and make it possible to undo the move.
Definition kis_paint_device.cpp:401
TDE_DEPRECATED TQ_UINT8 * writablePixel(TQ_INT32 x, TQ_INT32 y)
Get a read-write pointer to pixel (x, y).
Definition kis_paint_device.cpp:1223
virtual void setDirty()
Set the parent layer completely dirty, if this paint device has one.
Definition kis_paint_device.cpp:361
virtual void convertFromTQImage(const TQImage &img, const TQString &srcProfileName, TQ_INT32 offsetX=0, TQ_INT32 offsetY=0)
Fill this paint device with the data from img; starting at (offsetX, offsetY)
Definition kis_paint_device.cpp:804
void crop(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
Cut the paint device down to the specified rect.
Definition kis_paint_device.cpp:610
KisPaintDeviceSP createThumbnailDevice(TQ_INT32 w, TQ_INT32 h)
Creates a paint device thumbnail of the paint device, retaining the aspect ratio.
Definition kis_paint_device.cpp:873
bool extentIsValid() const
XXX: This should be a temporay hack, awaiting a proper fix.
Definition kis_paint_device.cpp:423
virtual TQ_INT32 pixelSize() const
Return the number of bytes a pixel takes.
Definition kis_paint_device.h:566
virtual bool write(KoStore *store)
Write the pixels of this paint device into the specified file store.
Definition kis_paint_device.cpp:700
virtual void move(TQ_INT32 x, TQ_INT32 y)
Moves the device to these new coordinates (so no incremental move or so)
Definition kis_paint_device.cpp:376
void applySelectionMask(KisSelectionSP mask)
Apply a mask to the image data, i.e.
Definition kis_paint_device.cpp:1110
KisSelectionSP setSelection(KisSelectionSP selection)
Sets the selection of this paint device to the new selection, returns the old selection,...
Definition kis_paint_device.cpp:1131
KisHLineIteratorPixel createHLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable)
This function return an iterator which points to the first pixel of a horizontal line.
Definition kis_paint_device.cpp:977
KisRandomAccessorPixel createRandomAccessor(TQ_INT32 x, TQ_INT32 y, bool writable)
This function creates a random accessor which allow to randomly access any pixels on the paint device...
Definition kis_paint_device.cpp:994
void emitSelectionChanged()
Notify the owning image that the current selection has changed.
Definition kis_paint_device.cpp:1006
bool setPixel(TQ_INT32 x, TQ_INT32 y, const TQColor &c, TQ_UINT8 opacity)
Set the specified pixel to the specified color.
Definition kis_paint_device.cpp:1176
bool hasSelection()
Whether there is a valid selection for this paintdevice.
Definition kis_paint_device.cpp:1037
void setExtentIsValid(bool isValid)
Convience method for the above.
Definition kis_paint_device.cpp:428
virtual void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const
Retrieve the bounds of the paint device.
Definition kis_paint_device.cpp:409
TQ_INT32 numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY)
Get the number of contiguous columns starting at x, valid for all values of y between minY and maxY.
Definition kis_paint_device.cpp:1203
virtual void exactBounds(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const
Get the exact bounds of this paint device.
Definition kis_paint_device.cpp:433
void subtractSelection(KisSelectionSP selection)
Subtracts the specified selection from the currently active selection for this paindevice.
Definition kis_paint_device.cpp:1070
void setData(KisDataManagerSP data, KisColorSpace *colorSpace)
Replace the pixel data, color strategy, and profile.
Definition kis_paint_device.cpp:783
virtual TQImage createThumbnail(TQ_INT32 maxw, TQ_INT32 maxh)
Creates a thumbnail of the paint device, retaining the aspect ratio.
Definition kis_paint_device.cpp:921
void fill(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel)
Fill the given rectangle with the given pixel.
Definition kis_paint_device.cpp:626
KisPainter contains the graphics primitives necessary to draw on a KisPaintDevice.
Definition kis_painter.h:56
void bitBlt(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP src, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 sw, TQ_INT32 sh)
Blast the specified region from src onto the current paint device.
Definition kis_painter.h:105
KisSelection contains a byte-map representation of a layer, where the value of a byte signifies wheth...
Definition kis_selection.h:43
