chalk

#include <kis_paint_device.h>

Inheritance diagram for KisPaintDevice:
KisSelection

Signals

void positionChanged (KisPaintDeviceSP device)
 
void ioProgress (TQ_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 DCOPObject * dcopObject ()
 
void lock (bool lock)
 
virtual bool write (KoStore *store)
 
virtual bool read (KoStore *store)
 
virtual void move (TQ_INT32 x, TQ_INT32 y)
 
virtual void move (const TQPoint &pt)
 
virtual KNamedCommand * moveCommand (TQ_INT32 x, TQ_INT32 y)
 
bool contains (TQ_INT32 x, TQ_INT32 y) const
 
bool contains (const TQPoint &pt) const
 
virtual void extent (TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const
 
virtual TQRect extent () const
 
bool extentIsValid () const
 
void setExtentIsValid (bool isValid)
 
virtual void exactBounds (TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const
 
virtual TQRect exactBounds () const
 
virtual TQRect exactBoundsOldMethod () const
 
virtual TQRect exactBoundsImprovedOldMethod () const
 
void crop (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
 
void crop (TQRect r)
 
virtual void clear ()
 
void fill (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel)
 
virtual void readBytes (TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
 
virtual void writeBytes (const TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
 
TQ_INT32 numContiguousColumns (TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY)
 
TQ_INT32 numContiguousRows (TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX)
 
TQ_INT32 rowStride (TQ_INT32 x, TQ_INT32 y)
 
TDE_DEPRECATED const TQ_UINT8 * pixel (TQ_INT32 x, TQ_INT32 y)
 
TDE_DEPRECATED TQ_UINT8 * writablePixel (TQ_INT32 x, TQ_INT32 y)
 
virtual void convertTo (KisColorSpace *dstColorSpace, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL)
 
virtual void setProfile (KisProfile *profile)
 
virtual void convertFromTQImage (const TQImage &img, const TQString &srcProfileName, TQ_INT32 offsetX=0, TQ_INT32 offsetY=0)
 
virtual TQImage convertToTQImage (KisProfile *dstProfile, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, float exposure=0.0f)
 
virtual TQImage convertToTQImage (KisProfile *dstProfile, float exposure=0.0f)
 
KisPaintDeviceSP createThumbnailDevice (TQ_INT32 w, TQ_INT32 h)
 
virtual TQImage createThumbnail (TQ_INT32 maxw, TQ_INT32 maxh)
 
bool pixel (TQ_INT32 x, TQ_INT32 y, TQColor *c, TQ_UINT8 *opacity)
 
bool pixel (TQ_INT32 x, TQ_INT32 y, KisColor *kc)
 
KisColor colorAt (TQ_INT32 x, TQ_INT32 y)
 
bool setPixel (TQ_INT32 x, TQ_INT32 y, const TQColor &c, TQ_UINT8 opacity)
 
bool setPixel (TQ_INT32 x, TQ_INT32 y, const KisColor &kc)
 
KisColorSpace * colorSpace () const
 
KisDataManagerSP dataManager () const
 
void setData (KisDataManagerSP data, KisColorSpace *colorSpace)
 
TQ_INT32 getX () const
 
TQ_INT32 getY () const
 
void setX (TQ_INT32 x)
 
void setY (TQ_INT32 y)
 
virtual TQ_INT32 pixelSize () const
 
virtual TQ_INT32 nChannels () const
 
KisImage * image () const
 
KisLayer * parentLayer () const
 
void setParentLayer (KisLayer *parentLayer)
 
virtual void setDirty (const TQRect &rc)
 
virtual void setDirty ()
 
void mirrorX ()
 
void mirrorY ()
 
KisMementoSP getMemento ()
 
void rollback (KisMementoSP memento)
 
void rollforward (KisMementoSP memento)
 
KisRectIteratorPixel createRectIterator (TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable)
 
KisHLineIteratorPixel createHLineIterator (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable)
 
KisVLineIteratorPixel createVLineIterator (TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable)
 
KisRandomAccessorPixel createRandomAccessor (TQ_INT32 x, TQ_INT32 y, bool writable)
 
KisRandomSubAccessorPixel createRandomSubAccessor ()
 
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 TQRect &r)
 
KisUndoAdapter * undoAdapter () const
 
KisExifInfo * exifInfo ()
 
bool hasExifInfo ()
 

Protected Attributes

KisDataManagerSP m_datamanager
 

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 73 of file kis_paint_device.h.

Constructor & Destructor Documentation

◆ KisPaintDevice() [1/3]

KisPaintDevice::KisPaintDevice ( KisColorSpace *  colorSpace,
const char *  name = 0 
)

Create a new paint device with the specified colorspace.

Parameters
colorSpacethe colorspace of this paint device
namefor debugging purposes

Definition at line 204 of file kis_paint_device.cpp.

◆ KisPaintDevice() [2/3]

KisPaintDevice::KisPaintDevice ( KisLayer *  parentLayer,
KisColorSpace *  colorSpace,
const char *  name = 0 
)

Create a new paint device with the specified colorspace.

The parentLayer will be notified of changes to this paint device.

Parameters
parentLayerthe layer that contains this paint device.
colorSpacethe colorspace of this paint device
namefor debugging purposes

Definition at line 239 of file kis_paint_device.cpp.

◆ KisPaintDevice() [3/3]

KisPaintDevice::KisPaintDevice ( const KisPaintDevice &  rhs)

Definition at line 287 of file kis_paint_device.cpp.

◆ ~KisPaintDevice()

KisPaintDevice::~KisPaintDevice ( )
virtual

Definition at line 323 of file kis_paint_device.cpp.

Member Function Documentation

◆ addSelection()

void KisPaintDevice::addSelection ( KisSelectionSP  selection)

Adds the specified selection to the currently active selection for this paintdevice.

Definition at line 1062 of file kis_paint_device.cpp.

◆ applySelectionMask()

void KisPaintDevice::applySelectionMask ( KisSelectionSP  mask)

Apply a mask to the image data, i.e.

multiply each pixel's opacity by its selectedness in the mask.

Definition at line 1110 of file kis_paint_device.cpp.

◆ clear()

void KisPaintDevice::clear ( )
virtual

Complete erase the current paint device.

Its size will become 0.

Reimplemented in KisSelection.

Definition at line 621 of file kis_paint_device.cpp.

◆ clearSelection()

void KisPaintDevice::clearSelection ( )

Clear the selected pixels from the paint device.

Definition at line 1081 of file kis_paint_device.cpp.

◆ colorAt()

KisColor KisPaintDevice::colorAt ( TQ_INT32  x,
TQ_INT32  y 
)

Return the KisColor of the pixel at x,y.

Definition at line 1169 of file kis_paint_device.cpp.

◆ colorSpace()

KisColorSpace * KisPaintDevice::colorSpace ( ) const
inline

Definition at line 579 of file kis_paint_device.h.

◆ contains() [1/2]

bool KisPaintDevice::contains ( const TQPoint &  pt) const

Convenience method for the above.

◆ contains() [2/2]

bool KisPaintDevice::contains ( TQ_INT32  x,
TQ_INT32  y 
) const

Returns true of x,y is within the extent of this paint device.

◆ convertFromTQImage()

void KisPaintDevice::convertFromTQImage ( const TQImage &  img,
const TQString &  srcProfileName,
TQ_INT32  offsetX = 0,
TQ_INT32  offsetY = 0 
)
virtual

Fill this paint device with the data from img; starting at (offsetX, offsetY)

Parameters
srcProfileNamename of the RGB profile to interpret the img as. "" is interpreted as sRGB

Definition at line 804 of file kis_paint_device.cpp.

◆ convertTo()

void KisPaintDevice::convertTo ( KisColorSpace *  dstColorSpace,
TQ_INT32  renderingIntent = INTENT_PERCEPTUAL 
)
virtual

Converts the paint device to a different colorspace.

Definition at line 716 of file kis_paint_device.cpp.

◆ convertToTQImage() [1/2]

TQImage KisPaintDevice::convertToTQImage ( KisProfile *  dstProfile,
float  exposure = 0.0f 
)
virtual

Create an RGBA TQImage from a rectangle in the paint device.

The rectangle is defined by the parent image's bounds.

Parameters
dstProfileRGB profile to use in conversion. May be 0, in which case it's up to the colour strategy to choose a profile (most like sRGB).
exposureThe exposure setting used to render a preview of a high dynamic range image.

Definition at line 831 of file kis_paint_device.cpp.

◆ convertToTQImage() [2/2]

TQImage KisPaintDevice::convertToTQImage ( KisProfile *  dstProfile,
TQ_INT32  x,
TQ_INT32  y,
TQ_INT32  w,
TQ_INT32  h,
float  exposure = 0.0f 
)
virtual

Create an RGBA TQImage from a rectangle in the paint device.

Parameters
xLeft coordinate of the rectangle
yTop coordinate of the rectangle
wWidth of the rectangle in pixels
hHeight of the rectangle in pixels
dstProfileRGB profile to use in conversion. May be 0, in which case it's up to the colour strategy to choose a profile (most like sRGB).
exposureThe exposure setting used to render a preview of a high dynamic range image.

Definition at line 853 of file kis_paint_device.cpp.

◆ createHLineIterator()

KisHLineIteratorPixel KisPaintDevice::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 at line 977 of file kis_paint_device.cpp.

◆ createRandomAccessor()

KisRandomAccessorPixel KisPaintDevice::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.

Note: random access is way slower than iterators, allways use iterators whenever you can

Definition at line 994 of file kis_paint_device.cpp.

◆ createRandomSubAccessor()

KisRandomSubAccessorPixel KisPaintDevice::createRandomSubAccessor ( )

This function create a random accessor which can easily access to sub pixel values.

Definition at line 1001 of file kis_paint_device.cpp.

◆ createRectIterator()

KisRectIteratorPixel KisPaintDevice::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 at line 969 of file kis_paint_device.cpp.

◆ createThumbnail()

TQImage KisPaintDevice::createThumbnail ( TQ_INT32  maxw,
TQ_INT32  maxh 
)
virtual

Creates a thumbnail of the paint device, retaining the aspect ratio.

The width and height of the returned TQImage won't exceed maxw and maxw, but they may be smaller. The colors are not corrected for display!

Definition at line 921 of file kis_paint_device.cpp.

◆ createThumbnailDevice()

KisPaintDeviceSP KisPaintDevice::createThumbnailDevice ( TQ_INT32  w,
TQ_INT32  h 
)

Creates a paint device thumbnail of the paint device, retaining the aspect ratio.

The width and height of the returned device won't exceed maxw and maxw, but they may be smaller.

Definition at line 873 of file kis_paint_device.cpp.

◆ createVLineIterator()

KisVLineIteratorPixel KisPaintDevice::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 at line 985 of file kis_paint_device.cpp.

◆ crop() [1/2]

void KisPaintDevice::crop ( TQ_INT32  x,
TQ_INT32  y,
TQ_INT32  w,
TQ_INT32  h 
)

Cut the paint device down to the specified rect.

Definition at line 610 of file kis_paint_device.cpp.

◆ crop() [2/2]

void KisPaintDevice::crop ( TQRect  r)

Convience method for the above.

Definition at line 616 of file kis_paint_device.cpp.

◆ dataManager()

KisDataManagerSP KisPaintDevice::dataManager ( ) const

Definition at line 1254 of file kis_paint_device.cpp.

◆ dcopObject()

DCOPObject * KisPaintDevice::dcopObject ( )
virtual

Definition at line 337 of file kis_paint_device.cpp.

◆ deselect()

void KisPaintDevice::deselect ( )

Deselect the selection for this paintdevice.

Definition at line 1048 of file kis_paint_device.cpp.

◆ emitSelectionChanged() [1/2]

void KisPaintDevice::emitSelectionChanged ( )

Notify the owning image that the current selection has changed.

Definition at line 1006 of file kis_paint_device.cpp.

◆ emitSelectionChanged() [2/2]

void KisPaintDevice::emitSelectionChanged ( const TQRect &  r)

Notify the owning image that the current selection has changed.

Parameters
rthe area for which the selection has changed

Definition at line 1013 of file kis_paint_device.cpp.

◆ exactBounds() [1/2]

TQRect KisPaintDevice::exactBounds ( ) const
virtual

Definition at line 604 of file kis_paint_device.cpp.

◆ exactBounds() [2/2]

void KisPaintDevice::exactBounds ( TQ_INT32 &  x,
TQ_INT32 &  y,
TQ_INT32 &  w,
TQ_INT32 &  h 
) const
virtual

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 433 of file kis_paint_device.cpp.

◆ exactBoundsImprovedOldMethod()

TQRect KisPaintDevice::exactBoundsImprovedOldMethod ( ) const
virtual

Definition at line 520 of file kis_paint_device.cpp.

◆ exactBoundsOldMethod()

TQRect KisPaintDevice::exactBoundsOldMethod ( ) const
virtual

Definition at line 442 of file kis_paint_device.cpp.

◆ exifInfo()

KisExifInfo * KisPaintDevice::exifInfo ( )

Return the exifInfo associated with this layer.

If no exif infos are available, the function will create it.

Definition at line 1259 of file kis_paint_device.cpp.

◆ extent() [1/2]

TQRect KisPaintDevice::extent ( ) const
virtual

Definition at line 416 of file kis_paint_device.cpp.

◆ extent() [2/2]

void KisPaintDevice::extent ( TQ_INT32 &  x,
TQ_INT32 &  y,
TQ_INT32 &  w,
TQ_INT32 &  h 
) const
virtual

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 409 of file kis_paint_device.cpp.

◆ extentIsValid()

bool KisPaintDevice::extentIsValid ( ) const

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 423 of file kis_paint_device.cpp.

◆ fill()

void KisPaintDevice::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 at line 626 of file kis_paint_device.cpp.

◆ getMemento()

KisMementoSP KisPaintDevice::getMemento ( )

Definition at line 691 of file kis_paint_device.cpp.

◆ getX()

TQ_INT32 KisPaintDevice::getX ( ) const
inline

The X offset of the paint device.

Definition at line 586 of file kis_paint_device.h.

◆ getY()

TQ_INT32 KisPaintDevice::getY ( ) const
inline

The Y offset of the paint device.

Definition at line 591 of file kis_paint_device.h.

◆ hasExifInfo()

bool KisPaintDevice::hasExifInfo ( )
inline

This function return true if the layer has exif info associated with it.

Definition at line 517 of file kis_paint_device.h.

◆ hasSelection()

bool KisPaintDevice::hasSelection ( )

Whether there is a valid selection for this paintdevice.

Definition at line 1037 of file kis_paint_device.cpp.

◆ image()

KisImage * KisPaintDevice::image ( ) const

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 366 of file kis_paint_device.cpp.

◆ lock()

void KisPaintDevice::lock ( bool  lock)
inline

Definition at line 105 of file kis_paint_device.h.

◆ mirrorX()

void KisPaintDevice::mirrorX ( )

Mirror the device along the X axis.

Definition at line 631 of file kis_paint_device.cpp.

◆ mirrorY()

void KisPaintDevice::mirrorY ( )

Mirror the device along the Y axis.

Definition at line 661 of file kis_paint_device.cpp.

◆ move() [1/2]

void KisPaintDevice::move ( const TQPoint &  pt)
virtual

Convenience method for the above.

Definition at line 396 of file kis_paint_device.cpp.

◆ move() [2/2]

void KisPaintDevice::move ( TQ_INT32  x,
TQ_INT32  y 
)
virtual

Moves the device to these new coordinates (so no incremental move or so)

Definition at line 376 of file kis_paint_device.cpp.

◆ moveCommand()

KNamedCommand * KisPaintDevice::moveCommand ( TQ_INT32  x,
TQ_INT32  y 
)
virtual

Move the paint device to the specified location and make it possible to undo the move.

Definition at line 401 of file kis_paint_device.cpp.

◆ nChannels()

TQ_INT32 KisPaintDevice::nChannels ( ) const
inlinevirtual

Return the number of channels a pixel takes.

Definition at line 572 of file kis_paint_device.h.

◆ numContiguousColumns()

TQ_INT32 KisPaintDevice::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 at line 1203 of file kis_paint_device.cpp.

◆ numContiguousRows()

TQ_INT32 KisPaintDevice::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 at line 1208 of file kis_paint_device.cpp.

◆ parentLayer()

KisLayer * KisPaintDevice::parentLayer ( ) const

Returns 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.cpp.

◆ pixel() [1/3]

const TQ_UINT8 * KisPaintDevice::pixel ( TQ_INT32  x,
TQ_INT32  y 
)

Get a read-only pointer to pixel (x, y).

Definition at line 1218 of file kis_paint_device.cpp.

◆ pixel() [2/3]

bool KisPaintDevice::pixel ( TQ_INT32  x,
TQ_INT32  y,
KisColor *  kc 
)

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.

Returns
true if the operation was succesful.

Definition at line 1156 of file kis_paint_device.cpp.

◆ pixel() [3/3]

bool KisPaintDevice::pixel ( TQ_INT32  x,
TQ_INT32  y,
TQColor *  c,
TQ_UINT8 *  opacity 
)

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.

Returns
true if the operation was succesful.

Definition at line 1142 of file kis_paint_device.cpp.

◆ pixelSize()

TQ_INT32 KisPaintDevice::pixelSize ( ) const
inlinevirtual

Return the number of bytes a pixel takes.

Definition at line 566 of file kis_paint_device.h.

◆ read()

bool KisPaintDevice::read ( KoStore *  store)
virtual

Fill this paint device with the pixels from the specified file store.

Definition at line 708 of file kis_paint_device.cpp.

◆ readBytes()

void KisPaintDevice::readBytes ( TQ_UINT8 *  data,
TQ_INT32  x,
TQ_INT32  y,
TQ_INT32  w,
TQ_INT32  h 
)
virtual

Read the bytes representing the rectangle described by x, y, w, h into data.

If data is not big enough, Chalk 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 1243 of file kis_paint_device.cpp.

◆ reselect()

void KisPaintDevice::reselect ( )

Reinstates the old selection.

Definition at line 1056 of file kis_paint_device.cpp.

◆ rollback()

void KisPaintDevice::rollback ( KisMementoSP  memento)

Definition at line 696 of file kis_paint_device.cpp.

◆ rollforward()

void KisPaintDevice::rollforward ( KisMementoSP  memento)

Definition at line 698 of file kis_paint_device.cpp.

◆ rowStride()

TQ_INT32 KisPaintDevice::rowStride ( TQ_INT32  x,
TQ_INT32  y 
)

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 1213 of file kis_paint_device.cpp.

◆ selection()

KisSelectionSP KisPaintDevice::selection ( )

Get the current selection or create one if this paintdevice hasn't got a selection yet.

Definition at line 1020 of file kis_paint_device.cpp.

◆ selectionDeselected()

bool KisPaintDevice::selectionDeselected ( )

Whether the previous selection was deselected.

Definition at line 1042 of file kis_paint_device.cpp.

◆ setData()

void KisPaintDevice::setData ( KisDataManagerSP  data,
KisColorSpace *  colorSpace 
)

Replace the pixel data, color strategy, and profile.

Definition at line 783 of file kis_paint_device.cpp.

◆ setDirty() [1/2]

void KisPaintDevice::setDirty ( )
virtual

Set the parent layer completely dirty, if this paint device has one.

Reimplemented in KisSelection.

Definition at line 361 of file kis_paint_device.cpp.

◆ setDirty() [2/2]

void KisPaintDevice::setDirty ( const TQRect &  rc)
virtual

Add the specified rect top the parent layer (if present)

Reimplemented in KisSelection.

Definition at line 356 of file kis_paint_device.cpp.

◆ setExtentIsValid()

void KisPaintDevice::setExtentIsValid ( bool  isValid)

Convience method for the above.

Definition at line 428 of file kis_paint_device.cpp.

◆ setParentLayer()

void KisPaintDevice::setParentLayer ( KisLayer *  parentLayer)

Set the KisLayer that contains this paint device, or 0 if this is not part of a layer.

Definition at line 351 of file kis_paint_device.cpp.

◆ setPixel() [1/2]

bool KisPaintDevice::setPixel ( TQ_INT32  x,
TQ_INT32  y,
const KisColor &  kc 
)

Definition at line 1185 of file kis_paint_device.cpp.

◆ setPixel() [2/2]

bool KisPaintDevice::setPixel ( TQ_INT32  x,
TQ_INT32  y,
const TQColor &  c,
TQ_UINT8  opacity 
)

Set the specified pixel to the specified color.

Note that this bypasses KisPainter. the PaintDevice is here used as an equivalent to TQImage, not TQPixmap. 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.

Returns
true if the operation was succesful

Definition at line 1176 of file kis_paint_device.cpp.

◆ setProfile()

void KisPaintDevice::setProfile ( KisProfile *  profile)
virtual

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 771 of file kis_paint_device.cpp.

◆ setSelection()

KisSelectionSP KisPaintDevice::setSelection ( KisSelectionSP  selection)

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 1131 of file kis_paint_device.cpp.

◆ setX()

void KisPaintDevice::setX ( TQ_INT32  x)

Return the X offset of the paint device.

Definition at line 1228 of file kis_paint_device.cpp.

◆ setY()

void KisPaintDevice::setY ( TQ_INT32  y)

Return the Y offset of the paint device.

Definition at line 1235 of file kis_paint_device.cpp.

◆ subtractSelection()

void KisPaintDevice::subtractSelection ( KisSelectionSP  selection)

Subtracts the specified selection from the currently active selection for this paindevice.

Definition at line 1070 of file kis_paint_device.cpp.

◆ undoAdapter()

KisUndoAdapter * KisPaintDevice::undoAdapter ( ) const

Definition at line 796 of file kis_paint_device.cpp.

◆ writablePixel()

TQ_UINT8 * KisPaintDevice::writablePixel ( TQ_INT32  x,
TQ_INT32  y 
)

Get a read-write pointer to pixel (x, y).

Definition at line 1223 of file kis_paint_device.cpp.

◆ write()

bool KisPaintDevice::write ( KoStore *  store)
virtual

Write the pixels of this paint device into the specified file store.

Definition at line 700 of file kis_paint_device.cpp.

◆ writeBytes()

void KisPaintDevice::writeBytes ( const TQ_UINT8 *  data,
TQ_INT32  x,
TQ_INT32  y,
TQ_INT32  w,
TQ_INT32  h 
)
virtual

Copy the bytes in data into the rect specified by x, y, w, h.

If the data is too small or uninitialized, Chalk 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 1248 of file kis_paint_device.cpp.

Member Data Documentation

◆ m_datamanager

KisDataManagerSP KisPaintDevice::m_datamanager
protected

Definition at line 531 of file kis_paint_device.h.


The documentation for this class was generated from the following files: