|
Krita Source Code Documentation
|
#include <kis_paint_device.h>
Inheritance diagram for KisPaintDevice:Classes | |
| struct | LodDataStruct |
| struct | MemoryReleaseObject |
| struct | Private |
Signals | |
| void | colorSpaceChanged (const KoColorSpace *colorspace) |
| void | profileChanged (const KoColorProfile *profile) |
Static Public Member Functions | |
| static MemoryReleaseObject * | createMemoryReleaseObject () |
Protected Member Functions | |
| void | fastBitBlt (KisPaintDeviceSP src, const QRect &rect) |
| void | fastBitBltOldData (KisPaintDeviceSP src, const QRect &rect) |
| bool | fastBitBltPossible (KisPaintDeviceSP src) |
| void | fastBitBltRough (KisPaintDeviceSP src, const QRect &rect) |
| void | fastBitBltRoughOldData (KisPaintDeviceSP src, const QRect &rect) |
| KisPaintDevice (KisDataManagerSP explicitDataManager, KisPaintDeviceSP src, const QString &name=QString()) | |
| KisNodeWSP | parentNode () const |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Private Member Functions | |
| QVector< qint32 > | channelSizes () const |
| void | emitColorSpaceChanged () |
| void | emitProfileChanged () |
| void | init (const KoColorSpace *colorSpace, KisDefaultBoundsBaseSP defaultBounds, KisNodeWSP parent, const QString &name) |
| KisPaintDevice & | operator= (const KisPaintDevice &) |
Private Attributes | |
| Private *const | m_d |
Friends | |
| class | DataReaderThread |
| class | KisPaintDeviceFramesInterface |
| class | KisPaintDeviceTest |
| class | KisPainter |
| class | KisSelectionTest |
| class | PaintDeviceCache |
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 (it is not positioned on the image with sub-pixel accuracy). A KisPaintDevice doesn't have any fixed size, the size changes dynamically when pixels are accessed by an iterator.
Definition at line 65 of file kis_paint_device.h.
|
explicit |
Create a new paint device with the specified colorspace.
| colorSpace | the colorspace of this paint device |
| name | for debugging purposes |
Definition at line 1043 of file kis_paint_device.cc.
References colorSpace(), and init().
| KisPaintDevice::KisPaintDevice | ( | KisNodeWSP | parent, |
| const KoColorSpace * | colorSpace, | ||
| KisDefaultBoundsBaseSP | defaultBounds = KisDefaultBoundsBaseSP(), | ||
| const QString & | name = QString() ) |
Create a new paint device with the specified colorspace. The parent node will be notified of changes to this paint device.
| parent | the node that contains this paint device |
| colorSpace | the colorspace of this paint device |
| defaultBounds | boundaries of the device in case it is empty |
| name | for debugging purposes |
Definition at line 1050 of file kis_paint_device.cc.
References colorSpace(), defaultBounds(), and init().
| KisPaintDevice::KisPaintDevice | ( | const KisPaintDevice & | rhs, |
| KritaUtils::DeviceCopyMode | copyMode = KritaUtils::CopySnapshot, | ||
| KisNode * | newParentNode = 0 ) |
Creates a copy of this device.
If copyMode is CopySnapshot, the newly created device clones the current frame of rhs only (default and efficient behavior). If copyFrames is CopyAllFrames, the new device is a deep copy of the source with all the frames included.
Definition at line 1082 of file kis_paint_device.cc.
References makeFullCopyFrom().
|
override |
|
protected |
A special constructor for usage in KisPixelSelection. It allows two paint devices to share a data manager.
| explicitDataManager | data manager to use inside paint device |
| src | source paint device to copy parameters from |
| name | for debugging purposes |
| bool KisPaintDevice::burnKeyframe | ( | ) |
Definition at line 2209 of file kis_paint_device.cc.
References burnKeyframe(), KisPaintDevice::Private::framesInterface, and m_d.
| bool KisPaintDevice::burnKeyframe | ( | int | frameID | ) |
burnKeyframe
Take a frame from the keyframe channel, Copy the contents onto the "base" frame, and completely remove the keyframe channel.
Should be useful for copy+paste operations where we shouldn't expect keyframe data to persist.
Parameterless version simply gets the current frameID.
| frameID | – frameID (from the framesInterface, not the time) to burn to device. |
Definition at line 2188 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), KisPaintDevice::Private::contentChannel, KisPaintDevice::Private::framesInterface, KIS_ASSERT_RECOVER_RETURN_VALUE, KisPaintDevice(), and m_d.
| QRect KisPaintDevice::calculateExactBounds | ( | bool | nonDefaultOnly | ) | const |
Calculates exact bounds of the device. Used internally by a transparent caching system. The solution is very slow because it does a linear scanline search. So the complexity is n*n at worst.
We will calculate exact bounds only outside of the image bounds, and that'll be nondefault area only.
Definition at line 1435 of file kis_paint_device.cc.
References KisRegion::boundingRect(), KisDefaultBoundsBase::bounds(), Impl::calculateExactBoundsImpl(), KisPaintDevice::Private::colorSpace(), KoColor::data(), defaultBounds(), defaultPixel(), extent(), m_d, OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), pixelSize(), and region().
| quint32 KisPaintDevice::channelCount | ( | ) | const |
Return the number of channels a pixel takes
Definition at line 2030 of file kis_paint_device.cc.
References KoColorSpace::channelCount(), KisPaintDevice::Private::colorSpace(), and m_d.
|
private |
Return a vector with in order the size in bytes of the channels in the colorspace of this paint device.
Definition at line 2122 of file kis_paint_device.cc.
References KoColorSpace::channels, colorSpace(), and KoChannelInfo::size().
|
virtual |
Complete erase the current paint device. Its size will become 0. This does not take the selection into account.
Reimplemented in KisPixelSelection.
Definition at line 1523 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisDataManager::clear(), KisPaintDevice::Private::dataManager(), KisPaintDeviceCache::invalidate(), and m_d.
| void KisPaintDevice::clear | ( | const QRect & | rc | ) |
Clear the given rectangle to transparent black. The paint device will expand to contain the given rect.
Definition at line 1529 of file kis_paint_device.cc.
References KisPaintDevice::Private::KisPaintDeviceStrategy::clear(), KisPaintDevice::Private::currentStrategy(), and m_d.
| void KisPaintDevice::clearSelection | ( | KisSelectionSP | selection | ) |
Clear the selected pixels from the paint device
Definition at line 1875 of file kis_paint_device.cc.
References KoColorSpace::applyInverseAlphaU8Mask(), KisPaintDevice::Private::colorSpace(), colorSpace(), createHLineConstIteratorNG(), createHLineIteratorNG(), KoColor::data(), KisPaintDevice::Private::dataManager(), defaultPixel(), m_d, KisBaseConstIteratorNG::nextPixel(), KisHLineConstIteratorNG::nextRow(), OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), KoColorSpace::opacityU8(), KoColorSpace::pixelSize(), KisSelection::projection(), KisDataManager::purge(), KisBaseConstAccessor::rawDataConst(), KisSelection::selectedExactRect(), setDirty(), KisPaintDevice::Private::x(), KisPaintDevice::Private::y(), and y().
| const KoColorSpace * KisPaintDevice::colorSpace | ( | ) | const |
Definition at line 2075 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), and m_d.
|
signal |
|
virtual |
This is a lowlevel method for the principle used in createCompositionSourceDevice(). In most of the cases the paint device creation methods should be used instead of this function.
Reimplemented in KisPixelSelection.
Definition at line 2117 of file kis_paint_device.cc.
References colorSpace().
| void KisPaintDevice::convertFromQImage | ( | const QImage & | image, |
| const KoColorProfile * | profile, | ||
| qint32 | offsetX = 0, | ||
| qint32 | offsetY = 0 ) |
Fill this paint device with the data from image; starting at (offsetX, offsetY)
| image | the image |
| profile | name of the RGB profile to interpret the image as. 0 is interpreted as sRGB |
| offsetX | x offset |
| offsetY | y offset |
Definition at line 1595 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), colorSpace(), KoColorSpaceRegistry::colorSpace(), KoColorSpace::convertPixelsTo(), KoID::id(), KoColorSpaceRegistry::instance(), Integer8BitsColorDepthID, KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), KisPaintDeviceCache::invalidate(), m_d, pixelSize(), RGBAColorModelID, warnKrita, and writeBytes().
| void KisPaintDevice::convertTo | ( | const KoColorSpace * | dstColorSpace, |
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags(), | ||
| KUndo2Command * | parentCommand = nullptr, | ||
| KoUpdater * | progressUpdater = nullptr ) |
Converts the paint device to a different colorspace
Definition at line 1571 of file kis_paint_device.cc.
References KisPaintDevice::Private::convertColorSpace(), and m_d.
| QImage KisPaintDevice::convertToQImage | ( | const KoColorProfile * | dstProfile, |
| const QRect & | rc, | ||
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) const |
Overridden method for convenience
Definition at line 1641 of file kis_paint_device.cc.
References convertToQImage().
| QImage KisPaintDevice::convertToQImage | ( | const KoColorProfile * | dstProfile, |
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) const |
Create an RGBA QImage from a rectangle in the paint device. The rectangle is defined by the parent image's bounds.
| dstProfile | RGB profile to use in conversion. May be 0, in which case it's up to the color strategy to choose a profile (most like sRGB). |
| renderingIntent | Rendering intent |
| conversionFlags | Conversion flags |
Definition at line 1625 of file kis_paint_device.cc.
References convertToQImage(), and exactBounds().
| QImage KisPaintDevice::convertToQImage | ( | const KoColorProfile * | dstProfile, |
| qint32 | x, | ||
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h, | ||
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) const |
Create an RGBA QImage from a rectangle in the paint device.
| dstProfile | RGB profile to use in conversion. May be 0, in which case it's up to the color strategy to choose a profile (most like sRGB). |
| x | Left coordinate of the rectangle |
| y | Top coordinate of the rectangle |
| w | Width of the rectangle in pixels |
| h | Height of the rectangle in pixels |
| renderingIntent | Rendering intent |
| conversionFlags | Conversion flags |
Definition at line 1651 of file kis_paint_device.cc.
References colorSpace(), KoColorSpace::convertToQImage(), pixelSize(), readBytes(), and warnKrita.
| KUndo2Command * KisPaintDevice::createChangeInterstrokeDataCommand | ( | KisInterstrokeDataSP | data | ) |
set interstroke data to the device
Interstroke data is managed by KisTransaction, don't call this method manually unless you really know what you are doing.
Definition at line 2042 of file kis_paint_device.cc.
References KisPaintDevice::Private::createChangeInterstrokeDataCommand(), and m_d.
| KisPaintDeviceSP KisPaintDevice::createCompositionSourceDevice | ( | ) | const |
There is quite a common technique in Krita. It is used in cases, when we want to paint something over a paint device using the composition, opacity or selection. E.g. painting a dab in a paint op, filling the selection in the Fill Tool. Such work is usually done in the following way:
1) Create a paint device
2) Fill it with the desired color or data
3) Create a KisPainter and set all the properties of the transaction: selection, compositeOp, opacity and etc.
4) Paint a newly created paint device over the destination device.
The following two methods (createCompositionSourceDevice() or createCompositionSourceDeviceFixed())should be used for the accomplishing the step 1). The point is that the desired color space of the temporary device may not coincide with the color space of the destination. That is the case, for example, for the alpha8() colorspace used in the selections. So for such devices the temporary target would have a different (grayscale) color space.
So there are two rules of thumb:
1) If you need a temporary device which you are going to fill with some data and then paint over the paint device, create it with either createCompositionSourceDevice() or createCompositionSourceDeviceFixed().
2) Do not expect that the color spaces of the destination and the temporary device would coincide. If you need to copy a single pixel from one device to another, you can use KisCrossDeviceColorSampler class, that will handle all the necessary conversions for you.
Definition at line 2081 of file kis_paint_device.cc.
References compositionSourceColorSpace(), defaultBounds(), KisPaintDevice(), setDefaultBounds(), setSupportsWraparoundMode(), and supportsWraproundMode().
| KisPaintDeviceSP KisPaintDevice::createCompositionSourceDevice | ( | KisPaintDeviceSP | cloneSource | ) | const |
The same as createCompositionSourceDevice(), but initializes the newly created device with the content of cloneSource
Definition at line 2089 of file kis_paint_device.cc.
References compositionSourceColorSpace(), convertTo(), defaultBounds(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), KisPaintDevice(), setDefaultBounds(), setSupportsWraparoundMode(), and supportsWraproundMode().
| KisPaintDeviceSP KisPaintDevice::createCompositionSourceDevice | ( | KisPaintDeviceSP | cloneSource, |
| const QRect | roughRect ) const |
The same as createCompositionSourceDevice(), but initializes the newly created device with the rough roughRect of cloneSource.
"Rough rect" means that it may copy a bit more than requested. It is expected that the caller will not use the area outside roughRect.
Definition at line 2100 of file kis_paint_device.cc.
References colorSpace(), compositionSourceColorSpace(), convertTo(), defaultBounds(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), KisPaintDevice(), makeCloneFromRough(), setDefaultBounds(), setSupportsWraparoundMode(), and supportsWraproundMode().
| KisFixedPaintDeviceSP KisPaintDevice::createCompositionSourceDeviceFixed | ( | ) | const |
This is a convenience method for createCompositionSourceDevice()
Definition at line 2112 of file kis_paint_device.cc.
References compositionSourceColorSpace().
| KisHLineConstIteratorSP KisPaintDevice::createHLineConstIteratorNG | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w ) const |
Definition at line 1832 of file kis_paint_device.cc.
References KisPaintDevice::Private::KisPaintDeviceStrategy::createHLineConstIteratorNG(), KisPaintDevice::Private::currentStrategy(), KisSharedPtr< T >::data(), KisPaintDevice::Private::dataManager(), m_d, KisPaintDevice::Private::x(), x(), KisPaintDevice::Private::y(), and y().
| KisHLineIteratorSP KisPaintDevice::createHLineIteratorNG | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w ) |
Definition at line 1826 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::KisPaintDeviceStrategy::createHLineIteratorNG(), KisPaintDevice::Private::currentStrategy(), KisSharedPtr< T >::data(), KisPaintDevice::Private::dataManager(), KisPaintDeviceCache::invalidate(), m_d, KisPaintDevice::Private::x(), x(), KisPaintDevice::Private::y(), and y().
| KisRasterKeyframeChannel * KisPaintDevice::createKeyframeChannel | ( | const KoID & | id | ) |
Create a keyframe channel for the content on this device.
| id | identifier for the channel |
Definition at line 2047 of file kis_paint_device.cc.
References KisPaintDevice::Private::contentChannel, KisPaintDevice::Private::defaultBounds, KisPaintDevice::Private::framesInterface, KisWeakSharedPtr< T >::isValid(), KisPaintDeviceFramesInterface, m_d, and KisPaintDevice::Private::parent.
| KisPaintDevice::LodDataStruct * KisPaintDevice::createLodDataStruct | ( | int | lod | ) |
Definition at line 2153 of file kis_paint_device.cc.
References KisPaintDevice::Private::createLodDataStruct(), and m_d.
|
static |
Definition at line 2139 of file kis_paint_device.cc.
| KisRandomAccessorSP KisPaintDevice::createRandomAccessorNG | ( | ) |
Definition at line 1858 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::KisPaintDeviceStrategy::createRandomAccessorNG(), KisPaintDevice::Private::currentStrategy(), KisPaintDeviceCache::invalidate(), and m_d.
| KisRandomConstAccessorSP KisPaintDevice::createRandomConstAccessorNG | ( | ) | const |
Definition at line 1864 of file kis_paint_device.cc.
References KisPaintDevice::Private::KisPaintDeviceStrategy::createRandomConstAccessorNG(), KisPaintDevice::Private::currentStrategy(), and m_d.
| KisRandomSubAccessorSP KisPaintDevice::createRandomSubAccessor | ( | ) | const |
This function create a random accessor which can easily access to sub pixel values.
Definition at line 1869 of file kis_paint_device.cc.
| KisRepeatHLineConstIteratorSP KisPaintDevice::createRepeatHLineConstIterator | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w, | ||
| const QRect & | _dataWidth ) const |
Create an iterator that will "artificially" extend the paint device with the value of the border when trying to access values outside the range of data.
| x | x of top left corner |
| y | y of top left corner |
| w | width of the border |
| _dataWidth | indicates the rectangle that truly contains data |
Definition at line 1848 of file kis_paint_device.cc.
References KisPaintDevice::Private::cacheInvalidator(), KisSharedPtr< T >::data(), KisPaintDevice::Private::dataManager(), m_d, KisPaintDevice::Private::x(), x(), KisPaintDevice::Private::y(), and y().
| KisRepeatVLineConstIteratorSP KisPaintDevice::createRepeatVLineConstIterator | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | h, | ||
| const QRect & | _dataWidth ) const |
Create an iterator that will "artificially" extend the paint device with the value of the border when trying to access values outside the range of data.
| x | x of top left corner |
| y | y of top left corner |
| h | height of the border |
| _dataWidth | indicates the rectangle that truly contains data |
Definition at line 1853 of file kis_paint_device.cc.
References KisPaintDevice::Private::cacheInvalidator(), KisSharedPtr< T >::data(), KisPaintDevice::Private::dataManager(), m_d, KisPaintDevice::Private::x(), x(), KisPaintDevice::Private::y(), and y().
| QImage KisPaintDevice::createThumbnail | ( | qint32 | maxw, |
| qint32 | maxh, | ||
| qreal | oversample = 1, | ||
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) |
Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect)
Definition at line 1808 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::createThumbnail(), fixThumbnailSize(), m_d, and oversample.
| QImage KisPaintDevice::createThumbnail | ( | qint32 | maxw, |
| qint32 | maxh, | ||
| QRect | rect, | ||
| qreal | oversample = 1, | ||
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) |
Creates a thumbnail of the paint device, retaining the aspect ratio. The width and height of the returned QImage won't exceed maxw and maxw, but they may be smaller. The colors are not corrected for display!
| maxw | maximum width |
| maxh | maximum height |
| rect | only this rect will be used for the thumbnail |
| oversample | ratio used for antialiasing |
| renderingIntent | Rendering intent |
| conversionFlags | Conversion flags |
Definition at line 1799 of file kis_paint_device.cc.
References convertToQImage(), createThumbnailDeviceOversampled(), fixThumbnailSize(), KoColorSpaceRegistry::instance(), and oversample.
| QImage KisPaintDevice::createThumbnail | ( | qint32 | maxw, |
| qint32 | maxh, | ||
| Qt::AspectRatioMode | aspectRatioMode, | ||
| qreal | oversample = 1, | ||
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags() ) |
Cached version of createThumbnail that also adjusts aspect ratio of the thumbnail to fit the extents of the paint device.
Definition at line 1815 of file kis_paint_device.cc.
References createThumbnail(), exactBounds(), and oversample.
| KisPaintDeviceSP KisPaintDevice::createThumbnailDevice | ( | qint32 | w, |
| qint32 | h, | ||
| QRect | rect = QRect(), | ||
| QRect | outputRect = QRect() ) const |
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.
| w | maximum width |
| h | maximum height |
| rect | only this rect will be used for the thumbnail |
| outputRect | output rectangle |
Definition at line 1724 of file kis_paint_device.cc.
References colorSpace(), createThumbnailDeviceInternal(), extent(), fixThumbnailSize(), and KisPaintDevice().
| KisPaintDeviceSP KisPaintDevice::createThumbnailDeviceOversampled | ( | qint32 | w, |
| qint32 | h, | ||
| qreal | oversample, | ||
| QRect | rect = QRect(), | ||
| QRect | outputRect = QRect() ) const |
Definition at line 1755 of file kis_paint_device.cc.
References colorSpace(), createThumbnailDeviceInternal(), extent(), fixThumbnailSize(), KisFilterStrategyRegistry::instance(), KisPaintDevice(), oversample, KisTransformWorker::run(), KoDummyUpdaterHolder::updater(), and KoGenericRegistry< T >::value().
| KisVLineConstIteratorSP KisPaintDevice::createVLineConstIteratorNG | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | h ) const |
Definition at line 1843 of file kis_paint_device.cc.
References KisPaintDevice::Private::KisPaintDeviceStrategy::createVLineConstIteratorNG(), KisPaintDevice::Private::currentStrategy(), m_d, x(), and y().
| KisVLineIteratorSP KisPaintDevice::createVLineIteratorNG | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | h ) |
Definition at line 1837 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::KisPaintDeviceStrategy::createVLineIteratorNG(), KisPaintDevice::Private::currentStrategy(), KisPaintDeviceCache::invalidate(), m_d, x(), and y().
| void KisPaintDevice::crop | ( | const QRect & | r | ) |
Convenience method for the above.
Definition at line 1498 of file kis_paint_device.cc.
References KisPaintDevice::Private::KisPaintDeviceStrategy::crop(), KisPaintDevice::Private::currentStrategy(), and m_d.
| void KisPaintDevice::crop | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h ) |
Cut the paint device down to the specified rect. If the crop area is bigger than the paint device, nothing will happen.
Definition at line 1492 of file kis_paint_device.cc.
| KisDataManagerSP KisPaintDevice::dataManager | ( | ) | const |
Definition at line 1590 of file kis_paint_device.cc.
References KisPaintDevice::Private::dataManager(), and m_d.
| KisDefaultBoundsBaseSP KisPaintDevice::defaultBounds | ( | ) | const |
the default bounds rect of the paint device
Definition at line 1212 of file kis_paint_device.cc.
References KisPaintDevice::Private::defaultBounds, and m_d.
| KoColor KisPaintDevice::defaultPixel | ( | ) | const |
Get a pointer to the default pixel. If the frame parameter is given, get the default pixel of specified frame. Otherwise use currently active frame.
Definition at line 1518 of file kis_paint_device.cc.
References colorSpace(), KisPaintDevice::Private::dataManager(), KisDataManager::defaultPixel(), and m_d.
|
private |
Definition at line 1561 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), colorSpaceChanged(), and m_d.
|
private |
Definition at line 1566 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), m_d, KoColorSpace::profile(), and profileChanged().
| void KisPaintDevice::estimateMemoryStats | ( | qint64 & | imageData, |
| qint64 & | temporaryData, | ||
| qint64 & | lodData ) const |
Definition at line 1189 of file kis_paint_device.cc.
References KisPaintDevice::Private::estimateMemoryStats(), and m_d.
| QRect KisPaintDevice::exactBounds | ( | ) | const |
Get the exact bounds of this paint device. The real solution is very slow because it does a linear scanline search, but it uses caching, so calling to this function without changing the device is quite cheap.
exactBounds follows these rules:
Definition at line 1277 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::exactBounds(), and m_d.
| QRect KisPaintDevice::exactBoundsAmortized | ( | ) | const |
Relaxed version of the exactBounds() that can be used in tight loops. If the exact bounds value is present in the paint device cache, returns this value. If the cache is invalidated, returns extent() and tries to recalculate the exact bounds not faster than once in 1000 ms.
Definition at line 1282 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::exactBoundsAmortized(), and m_d.
| QRect KisPaintDevice::extent | ( | ) | const |
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.
If default pixel is not transparent, then the actual extent rect is united with the defaultBounds()->bounds() value (the size of the image, usually).
Definition at line 1262 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::extent(), and m_d.
| void KisPaintDevice::extent | ( | qint32 & | x, |
| qint32 & | y, | ||
| qint32 & | w, | ||
| qint32 & | h ) const |
|
protected |
Clones rect from another paint device. The cloned area will be shared between both paint devices as much as possible using copy-on-write. Parts of the rect that cannot be shared (cross tiles) are deep-copied,
Definition at line 1972 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::fastBitBlt(), and m_d.
|
protected |
The same as fastBitBlt() but reads old data
Definition at line 1977 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::fastBitBltOldData(), and m_d.
|
protected |
Checks whether a src paint device can be used as source of fast bitBlt operation. The result of the check may depend on whether color spaces coincide, whether there is any shift of tiles between the devices and etc.
WARNING: This check must be done before performing any fast bitBlt operation!
Definition at line 1967 of file kis_paint_device.cc.
References KisPaintDevice::Private::fastBitBltPossible(), and m_d.
|
protected |
Clones rect from another paint device in a rough and fast way. All the tiles touched by rect will be shared, between both devices, that means it will copy a bigger area than was requested. This method is supposed to be used for bitBlt'ing into temporary paint devices.
Definition at line 1982 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::fastBitBltRough(), and m_d.
|
protected |
The same as fastBitBltRough() but reads old data
Definition at line 1987 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::fastBitBltRoughOldData(), and m_d.
Fill the given rectangle with the given pixel. The paint device will expand to contain the given rect.
Definition at line 1534 of file kis_paint_device.cc.
References colorSpace(), KoColor::colorSpace(), KisPaintDevice::Private::currentStrategy(), KoColor::data(), KisPaintDevice::Private::KisPaintDeviceStrategy::fill(), KIS_ASSERT_RECOVER_RETURN, and m_d.
| void KisPaintDevice::fill | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h, | ||
| const quint8 * | fillPixel ) |
Overloaded function. For legacy purposes only. Please use fill(const QRect & rc, const KoColor &color) instead
Definition at line 1540 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), KisPaintDevice::Private::KisPaintDeviceStrategy::fill(), m_d, x(), and y().
| KisPaintDeviceFramesInterface * KisPaintDevice::framesInterface | ( | ) |
An interface to modify/load/save frames stored inside this device
Definition at line 2183 of file kis_paint_device.cc.
References KisPaintDevice::Private::framesInterface, and m_d.
| void KisPaintDevice::generateLodCloneDevice | ( | KisPaintDeviceSP | dst, |
| const QRect & | originalRect, | ||
| int | lod ) |
Definition at line 2168 of file kis_paint_device.cc.
References KisPaintDevice::Private::generateLodCloneDevice(), and m_d.
|
private |
Definition at line 1057 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), colorSpace(), KoColor::createTransparent(), KoColor::data(), KisPaintDevice::Private::defaultBounds, defaultBounds(), KisPaintDevice::Private::init(), m_d, setDefaultBounds(), setParentNode(), and KisPaintDevice::Private::transitionalDefaultBounds.
| KisInterstrokeDataSP KisPaintDevice::interstrokeData | ( | ) | const |
This data is managed by KisTransaction and can be used by brushes to store some data that can be shared between the strokes. For example, information about drying of the pigment.
The interstroke data is stored in a per-frame manner, that is, there is a separate per-stroke data for each frame.
Definition at line 2037 of file kis_paint_device.cc.
References KisPaintDevice::Private::interstrokeData(), and m_d.
| KisRasterKeyframeChannel * KisPaintDevice::keyframeChannel | ( | ) | const |
Definition at line 2067 of file kis_paint_device.cc.
References KisPaintDevice::Private::contentChannel, and m_d.
| void KisPaintDevice::makeCloneFrom | ( | KisPaintDeviceSP | src, |
| const QRect & | rect ) |
Make this device to become a clone of src. It will have the same x,y shifts, colorspace and will share pixels inside rect. After calling this function: (this->extent() >= this->exactBounds() == rect).
Rule of thumb:
"Use makeCloneFrom() or makeCloneFromRough() if and only if you are the only owner of the destination paint device and you are 100% sure no other thread has access to it"
Definition at line 1127 of file kis_paint_device.cc.
References fastBitBlt(), and prepareClone().
| void KisPaintDevice::makeCloneFromRough | ( | KisPaintDeviceSP | src, |
| const QRect & | minimalRect ) |
Make this device to become a clone of src. It will have the same x,y shifts, colorspace and will share pixels inside rect. Be careful, this function will copy at least rect of pixels. Actual copy area will be a bigger - it will be aligned by tiles borders. So after calling this function: (this->extent() == this->exactBounds() >= rect).
Rule of thumb:
"Use makeCloneFrom() or makeCloneFromRough() if and only if you are the only owner of the destination paint device and you are 100% sure no other thread has access to it"
Definition at line 1138 of file kis_paint_device.cc.
References fastBitBltRough(), and prepareClone().
| void KisPaintDevice::makeFullCopyFrom | ( | const KisPaintDevice & | rhs, |
| KritaUtils::DeviceCopyMode | copyMode = KritaUtils::CopySnapshot, | ||
| KisNode * | newParentNode = 0 ) |
Definition at line 1092 of file kis_paint_device.cc.
References KisPaintDevice::Private::cloneAllDataObjects(), KisPaintDevice::Private::contentChannel, KritaUtils::CopyAllFrames, KisPaintDevice::Private::defaultBounds, KisPaintDevice::Private::framesInterface, KIS_ASSERT_RECOVER_RETURN, KisPaintDeviceFramesInterface, m_d, setDefaultBounds(), setParentNode(), KisPaintDevice::Private::supportsWrapAroundMode, and KisPaintDevice::Private::transitionalDefaultBounds.
|
virtual |
Convenience method for the above.
Reimplemented in KisPixelSelection, and KisPixelSelection.
Definition at line 1217 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::currentStrategy(), KisPaintDeviceCache::invalidate(), m_d, and KisPaintDevice::Private::KisPaintDeviceStrategy::move().
| void KisPaintDevice::moveTo | ( | qint32 | x, |
| qint32 | y ) |
Moves the device to these new coordinates (no incremental move)
Definition at line 1228 of file kis_paint_device.cc.
| QRect KisPaintDevice::nonDefaultPixelArea | ( | ) | const |
Returns exact rectangle of the paint device that contains non-default pixels. For paint devices with fully transparent default pixel is equivalent to exactBounds().
nonDefaultPixelArea() follows these rules:
Definition at line 1272 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), m_d, and KisPaintDeviceCache::nonDefaultPixelArea().
| QPoint KisPaintDevice::offset | ( | ) | const |
|
private |
|
protected |
Definition at line 1201 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::parent.
| KoColor KisPaintDevice::pixel | ( | const QPoint & | pos | ) | const |
Return pixel value in a form of KoColor. Please don't use this method for iteration, it is highly inefficient. Use iterators instead.
Definition at line 1936 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), createHLineConstIteratorNG(), m_d, and KisBaseConstAccessor::rawDataConst().
| bool KisPaintDevice::pixel | ( | qint32 | x, |
| qint32 | y, | ||
| KoColor * | kc ) const |
Fill kc with the values found at x and y. This method differs from the above in using KoColor, 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 1923 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), createHLineConstIteratorNG(), m_d, KisBaseConstAccessor::rawDataConst(), KoColor::setColor(), x(), and y().
| bool KisPaintDevice::pixel | ( | qint32 | x, |
| qint32 | y, | ||
| QColor * | c ) const |
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 1909 of file kis_paint_device.cc.
References colorSpace(), createHLineConstIteratorNG(), KisBaseConstAccessor::rawDataConst(), KoColorSpace::toQColor(), x(), and y().
| quint32 KisPaintDevice::pixelSize | ( | ) | const |
Return the number of bytes a pixel takes.
Definition at line 2023 of file kis_paint_device.cc.
References KisPaintDevice::Private::colorSpace(), m_d, and KoColorSpace::pixelSize().
| void KisPaintDevice::prepareClone | ( | KisPaintDeviceSP | src | ) |
Prepares the device for fastBitBlt operation. It clears the device, switches x,y shifts and colorspace if needed. After this call fastBitBltPossible will return true. May be used for initialization of temporary devices.
Definition at line 1122 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::prepareClone().
|
signal |
| void KisPaintDevice::purgeDefaultPixels | ( | ) |
Frees the memory occupied by the pixels containing default values. The extents() and exactBounds() of the paint device will probably also shrink
Definition at line 1503 of file kis_paint_device.cc.
References KisPaintDevice::Private::dataManager(), KisDataManager::extent(), m_d, and KisDataManager::purge().
| bool KisPaintDevice::read | ( | QIODevice * | stream | ) |
Fill this paint device with the pixels from the specified file store.
Definition at line 1551 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::dataManager(), KisPaintDeviceCache::invalidate(), m_d, and KisDataManager::read().
| void KisPaintDevice::readBytes | ( | quint8 * | data, |
| const QRect & | rect ) const |
Read the bytes representing the rectangle rect 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.
| data | The address of the memory to receive the bytes read |
| rect | The rectangle in the paint device to read from |
Definition at line 1997 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), m_d, and KisPaintDevice::Private::KisPaintDeviceStrategy::readBytes().
| void KisPaintDevice::readBytes | ( | quint8 * | data, |
| qint32 | x, | ||
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h ) const |
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 1992 of file kis_paint_device.cc.
References readBytes(), x(), and y().
| QVector< quint8 * > KisPaintDevice::readPlanarBytes | ( | qint32 | x, |
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h ) const |
Copy the bytes in the paint device into a vector of arrays of bytes, where the number of arrays is the number of channels in the paint device. If the specified area is larger than the paint device's extent, the default pixel will be read.
Definition at line 2012 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), m_d, KisPaintDevice::Private::KisPaintDeviceStrategy::readPlanarBytes(), x(), and y().
| KisRegion KisPaintDevice::region | ( | ) | const |
Returns a rough approximation of region covered by device. For tiled data manager, it region will consist of a number of rects each corresponding to a tile.
Definition at line 1267 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), m_d, and KisPaintDevice::Private::KisPaintDeviceStrategy::region().
| KisRegion KisPaintDevice::regionExact | ( | ) | const |
The slow version of region() that searches for exact bounds of each rectangle in the region
Definition at line 1468 of file kis_paint_device.cc.
References Impl::calculateExactBoundsImpl(), KoColor::data(), defaultPixel(), pixelSize(), KisRegion::rects(), region(), and KritaUtils::splitRectIntoPatches().
| KisRegion KisPaintDevice::regionForLodSyncing | ( | ) | const |
Definition at line 2148 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::regionForLodSyncing().
| KUndo2Command * KisPaintDevice::reincarnateWithDetachedHistory | ( | bool | copyContent | ) |
Converts a paint device into a "new" paint device, that has unconnected history. That is, after reincarnation, the device's life starts a new page. No history. No memories.
When the device is fed up with the new life, it can reincarnate back to its previous life by undoing the command returned by reincarnateWithDetachedHistory(). The old undo will continue working as if nothing has happened.
NOTE: reincarnation affects only the current lod plane and/or current frame. All other frames are kept unaffected.
| copyContent | decides if the device should take its current content to the new life |
Definition at line 1585 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::reincarnateWithDetachedHistory().
| void KisPaintDevice::requestTimeSwitch | ( | int | time | ) |
Called by KisTransactionData when it thinks current time should be changed. And the requests is forwarded to the image if needed.
Definition at line 1177 of file kis_paint_device.cc.
References KisWeakSharedPtr< T >::isValid(), m_d, KisPaintDevice::Private::parent, and KisNode::requestTimeSwitch().
| int KisPaintDevice::sequenceNumber | ( | ) | const |
Definition at line 1184 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), m_d, and KisPaintDeviceCache::sequenceNumber().
| void KisPaintDevice::setDataManager | ( | KisDataManagerSP | data, |
| const KoColorSpace * | colorSpace = 0 ) |
Replace the pixel data, color strategy, and profile.
| void KisPaintDevice::setDefaultBounds | ( | KisDefaultBoundsBaseSP | bounds | ) |
set the default bounds for the paint device when the default pixel is not completely transparent
Definition at line 1206 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::defaultBounds, defaultBounds(), KisPaintDeviceCache::invalidate(), and m_d.
Sets the default pixel. New data will be initialised with this pixel. The pixel is copied: the caller still owns the pointer and needs to delete it to avoid memory leaks. If frame ID is given, set default pixel for that frame. Otherwise use active frame.
Definition at line 1509 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), colorSpace(), KoColor::convertTo(), KoColor::data(), KisPaintDevice::Private::dataManager(), KisPaintDeviceCache::invalidate(), m_d, and KisDataManager::setDefaultPixel().
| void KisPaintDevice::setDirty | ( | ) |
Set the parent layer completely dirty, if this paint device has as parent layer.
Definition at line 1149 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::invalidate(), KisWeakSharedPtr< T >::isValid(), m_d, KisPaintDevice::Private::parent, and KisNode::setDirty().
Definition at line 1163 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::invalidate(), KisWeakSharedPtr< T >::isValid(), m_d, KisPaintDevice::Private::parent, region(), and KisNode::setDirty().
| void KisPaintDevice::setDirty | ( | const QRect & | rc | ) |
Add the specified rect to the parent layer's set of dirty rects (if there is a parent layer)
Definition at line 1156 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::invalidate(), KisWeakSharedPtr< T >::isValid(), m_d, KisPaintDevice::Private::parent, and KisNode::setDirty().
Definition at line 1170 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDeviceCache::invalidate(), KisWeakSharedPtr< T >::isValid(), m_d, KisPaintDevice::Private::parent, and KisNode::setDirty().
| void KisPaintDevice::setParentNode | ( | KisNodeWSP | parent | ) |
set the parent node of the paint device
Definition at line 1194 of file kis_paint_device.cc.
References KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, and KisPaintDevice::Private::parent.
| bool KisPaintDevice::setPixel | ( | qint32 | x, |
| qint32 | y, | ||
| const KoColor & | kc ) |
Convenience method for the above.
Definition at line 1951 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), KisPaintDevice::Private::colorSpace(), KoColor::colorSpace(), createHLineIteratorNG(), KoColor::data(), KisPaintDeviceCache::invalidate(), m_d, KoColorSpace::pixelSize(), x(), and y().
| bool KisPaintDevice::setPixel | ( | qint32 | x, |
| qint32 | y, | ||
| const QColor & | c ) |
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 1942 of file kis_paint_device.cc.
References KisPaintDevice::Private::cache(), colorSpace(), createHLineIteratorNG(), KoColorSpace::fromQColor(), KisPaintDeviceCache::invalidate(), m_d, x(), and y().
| bool KisPaintDevice::setProfile | ( | const KoColorProfile * | profile, |
| KUndo2Command * | parentCommand ) |
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 1580 of file kis_paint_device.cc.
References KisPaintDevice::Private::assignProfile(), and m_d.
| void KisPaintDevice::setProjectionDevice | ( | bool | value | ) |
Definition at line 1117 of file kis_paint_device.cc.
References KisPaintDevice::Private::isProjectionDevice, m_d, and value().
| void KisPaintDevice::setSupportsWraparoundMode | ( | bool | value | ) |
Definition at line 2173 of file kis_paint_device.cc.
References m_d, KisPaintDevice::Private::supportsWrapAroundMode, and value().
| void KisPaintDevice::setX | ( | qint32 | x | ) |
set the X offset of the paint device
Definition at line 1233 of file kis_paint_device.cc.
References m_d, moveTo(), x(), and KisPaintDevice::Private::y().
| void KisPaintDevice::setY | ( | qint32 | y | ) |
set the Y offset of the paint device
Definition at line 1238 of file kis_paint_device.cc.
References m_d, moveTo(), KisPaintDevice::Private::x(), and y().
| bool KisPaintDevice::supportsWraproundMode | ( | ) | const |
Definition at line 2178 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::supportsWrapAroundMode.
| void KisPaintDevice::testingFetchLodDevice | ( | KisPaintDeviceSP | targetDevice | ) |
Definition at line 2350 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::testingFetchLodDevice().
| void KisPaintDevice::updateLodDataStruct | ( | LodDataStruct * | dst, |
| const QRect & | srcRect ) |
Definition at line 2158 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::updateLodDataStruct().
| void KisPaintDevice::uploadLodDataStruct | ( | LodDataStruct * | dst | ) |
Definition at line 2163 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::uploadLodDataStruct().
| bool KisPaintDevice::write | ( | KisPaintDeviceWriter & | store | ) |
Write the pixels of this paint device into the specified file store.
Definition at line 1546 of file kis_paint_device.cc.
References KisPaintDevice::Private::dataManager(), m_d, and KisDataManager::write().
| void KisPaintDevice::writeBytes | ( | const quint8 * | data, |
| const QRect & | rect ) |
Copy the bytes in data into the rectangle rect. 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.
| data | The address of the memory to write bytes from |
| rect | The rectangle in the paint device to write to |
Definition at line 2007 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), m_d, and KisPaintDevice::Private::KisPaintDeviceStrategy::writeBytes().
| void KisPaintDevice::writeBytes | ( | const quint8 * | data, |
| qint32 | x, | ||
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h ) |
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 2002 of file kis_paint_device.cc.
References writeBytes(), x(), and y().
| void KisPaintDevice::writePlanarBytes | ( | QVector< quint8 * > | planes, |
| qint32 | x, | ||
| qint32 | y, | ||
| qint32 | w, | ||
| qint32 | h ) |
Write the data in the separate arrays to the channels. If there are less vectors than channels, the remaining channels will not be copied. If any of the arrays points to 0, the channel in that location will not be touched. If the specified area is larger than the paint device, the paint device will be extended. There are no guards: if the area covers more pixels than there are bytes in the arrays, krita will happily fill your paint device with areas of memory you never wanted to be read. Krita may also crash.
XXX: what about undo?
Definition at line 2017 of file kis_paint_device.cc.
References KisPaintDevice::Private::currentStrategy(), m_d, KisPaintDevice::Private::KisPaintDeviceStrategy::writePlanarBytes(), x(), and y().
| qint32 KisPaintDevice::x | ( | ) | const |
The X offset of the paint device
Definition at line 1243 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::x().
| qint32 KisPaintDevice::y | ( | ) | const |
The Y offset of the paint device
Definition at line 1248 of file kis_paint_device.cc.
References m_d, and KisPaintDevice::Private::y().
|
friend |
Definition at line 355 of file kis_paint_device.h.
|
friend |
Definition at line 952 of file kis_paint_device.h.
|
friend |
Definition at line 354 of file kis_paint_device.h.
|
friend |
Definition at line 940 of file kis_paint_device.h.
|
friend |
Definition at line 955 of file kis_paint_device.h.
|
friend |
Definition at line 896 of file kis_paint_device.h.
|
private |
Definition at line 960 of file kis_paint_device.h.