|
Krita Source Code Documentation
|
#include <kis_image_pyramid.h>
Inheritance diagram for KisImagePyramid:Public Member Functions | |
| void | alignSourceRect (QRect &rect, qreal scale) override |
| QImage | convertToQImage (qreal scale, const QRect &unscaledRect, enum Qt::TransformationMode transformMode) |
| QImage | convertToQImage (qreal scale, qint32 unscaledX, qint32 unscaledY, qint32 unscaledWidth, qint32 unscaledHeight) |
| void | drawFromOriginalImage (QPainter &gc, KisPPUpdateInfoSP info) override |
| void | drawImage (qreal scale, QPainter &gc, const QPoint &topLeftScaled, const QRect &unscaledSourceRect) |
| KisImagePatch | getNearestPatch (KisPPUpdateInfoSP info) override |
| KisImagePyramid (qint32 pyramidHeight) | |
| void | recalculateCache (KisPPUpdateInfoSP info) override |
| void | setChannelFlags (const QBitArray &channelFlags) override |
| void | setDisplayFilter (QSharedPointer< KisDisplayFilter > displayFilter) override |
| void | setImage (KisImageWSP newImage) override |
| void | setImageSize (qint32 w, qint32 h) override |
| void | setMonitorProfile (const KoColorProfile *monitorProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) override |
| void | updateCache (const QRect &dirtyImageRect) override |
| ~KisImagePyramid () override | |
Public Member Functions inherited from KisProjectionBackend | |
| virtual | ~KisProjectionBackend () |
Private Slots | |
| void | configChanged () |
Private Member Functions | |
| void | clearPyramid () |
| QImage | convertToQImageFast (KisPaintDeviceSP paintDevice, const QRect &unscaledRect) |
| QRect | downsampleByFactor2 (const QRect &srcRect, KisPaintDevice *src, KisPaintDevice *dst) |
| void | downsamplePixels (const quint8 *srcRow0, const quint8 *srcRow1, quint8 *dstRow, qint32 numSrcPixels) |
| int | findFirstGoodPlaneIndex (qreal scale, QSize originalSize) |
| void | rebuildPyramid () |
| void | retrieveImageData (const QRect &rect) |
Private Attributes | |
| bool | m_allChannelsSelected {false} |
| QBitArray | m_channelFlags |
| KoColorConversionTransformation::ConversionFlags | m_conversionFlags { KoColorConversionTransformation::Empty } |
| QSharedPointer< KisDisplayFilter > | m_displayFilter |
| const KoColorSpace * | m_monitorColorSpace {0} |
| const KoColorProfile * | m_monitorProfile {0} |
| bool | m_onlyOneChannelSelected {false} |
| KisImageWSP | m_originalImage |
| QVector< KisPaintDeviceSP > | m_pyramid |
| qint32 | m_pyramidHeight {0} |
| KoColorConversionTransformation::Intent | m_renderingIntent { KoColorConversionTransformation::IntentPerceptual } |
| int | m_selectedChannelIndex {-1} |
| bool | m_useOcio {false} |
Definition at line 20 of file kis_image_pyramid.h.
| KisImagePyramid::KisImagePyramid | ( | qint32 | pyramidHeight | ) |
Definition at line 87 of file kis_image_pyramid.cpp.
References configChanged(), connect(), and KisConfigNotifier::instance().
|
override |
Definition at line 96 of file kis_image_pyramid.cpp.
References setImage().
|
overridevirtual |
Some backends cannot work with arbitrary areas due to scaling stuff. That's why KisPrescaledProjection asks a backend to align an image rect before any operations.
Assume that KisImage pixels are always positive It allows us to use binary op-s for aligning
Here is a workaround of Qt's QRect::right()/bottom() "historical reasons". It should be one pixel smaller than actual right/bottom position
Reimplemented from KisProjectionBackend.
Definition at line 418 of file kis_image_pyramid.cpp.
References alignByPow2ButOneHi(), alignByPow2Lo(), dbgRender, and findFirstGoodPlaneIndex().
|
private |
Definition at line 151 of file kis_image_pyramid.cpp.
References m_pyramid, and m_pyramidHeight.
|
privateslot |
Definition at line 485 of file kis_image_pyramid.cpp.
References m_useOcio, and KisConfig::useOcio().
| QImage KisImagePyramid::convertToQImage | ( | qreal | scale, |
| const QRect & | unscaledRect, | ||
| enum Qt::TransformationMode | transformMode ) |
Render the projection onto a QImage. Color profiling occurs here
| QImage KisImagePyramid::convertToQImage | ( | qreal | scale, |
| qint32 | unscaledX, | ||
| qint32 | unscaledY, | ||
| qint32 | unscaledWidth, | ||
| qint32 | unscaledHeight ) |
|
private |
Fast workaround for converting paintDevices
Definition at line 472 of file kis_image_pyramid.cpp.
References KisPaintDevice::dataManager(), and KisDataManager::readBytes().
|
private |
Downsamples @srcRect from @src paint device and writes result into proper place of @dst paint device Returns modified rect of @dst paintDevice
Definition at line 316 of file kis_image_pyramid.cpp.
References alignRectBy2(), KisPaintDevice::createHLineIteratorNG(), downsamplePixels(), isOdd, KisBaseConstIteratorNG::nConseqPixels(), KisBaseConstIteratorNG::nextPixels(), KisHLineConstIteratorNG::nextRow(), and KisBaseConstAccessor::oldRawData().
|
private |
Auxiliary function. Downsamples two lines in @srcRow0 and @srcRow1 into one line @dstRow Note: @numSrcPixels must be EVEN
FIXME (mandatory): Use SSE and friends here.
Definition at line 362 of file kis_image_pyramid.cpp.
|
overridevirtual |
Draws a piece of original image onto gc 's canvas info.imageRect - area in KisImage pixels where to read from info.viewportRect - area in canvas pixels where to write to If info.imageRect and info.viewportRect don't agree, the image will be scaled info.borderWidth has the same meaning as in getNearestPatch info.renderHints - hints, transmitted to QPainter during drawing
Implements KisProjectionBackend.
Definition at line 466 of file kis_image_pyramid.cpp.
References KisImagePatch::drawMe(), and getNearestPatch().
| void KisImagePyramid::drawImage | ( | qreal | scale, |
| QPainter & | gc, | ||
| const QPoint & | topLeftScaled, | ||
| const QRect & | unscaledSourceRect ) |
Draw the projection onto a QPainter. Color profiling occurs here
|
private |
Searches for the last pyramid plane that can cover canvas on current zoom level
Definition at line 395 of file kis_image_pyramid.cpp.
References dbgRender, m_pyramidHeight, and SCALE_FROM_INDEX.
|
overridevirtual |
Gets a patch from a backend that can draw a info.imageRect on some QPainter in future. info.scaleX and info.scaleY are the scales of planned drawing, btw, it doesn't mean that an QImage inside the patch will have these scales - it'll have the nearest suitable scale or even original scale (e.g. KisProjectionCache)
If info.borderWidth is non-zero, info.requestedRect will be expended by info.borderWidth pixels to all directions and image of this rect will actually be written to the patch's QImage. That is done to eliminate border effects in smooth scaling.
Implements KisProjectionBackend.
Definition at line 449 of file kis_image_pyramid.cpp.
References alignByPow2Hi(), convertToQImageFast(), findFirstGoodPlaneIndex(), m_pyramid, KisImagePatch::patchRect(), SCALE_FROM_INDEX, and KisImagePatch::setImage().
|
private |
Definition at line 143 of file kis_image_pyramid.cpp.
References m_monitorColorSpace, m_pyramid, and m_pyramidHeight.
|
overridevirtual |
Prescales the cache of the backend. It is intended to be called from a separate thread where you can easily do the calculations. No data transfers with KisImage should happen during this phase
Implements KisProjectionBackend.
Definition at line 288 of file kis_image_pyramid.cpp.
References downsampleByFactor2(), FIRST_NOT_ORIGINAL_INDEX, m_conversionFlags, m_monitorProfile, m_pyramid, m_pyramidHeight, m_renderingIntent, and ORIGINAL_INDEX.
|
private |
Definition at line 211 of file kis_image_pyramid.cpp.
References KoColorSpace::channelCount(), KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KoColorSpaceRegistry::colorSpace(), KoColorSpace::convertChannelToVisualRepresentation(), KoColorSpace::convertPixelsTo(), Float32BitsColorDepthID, KoID::id(), KoColorSpaceRegistry::instance(), Integer8BitsColorDepthID, KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), m_allChannelsSelected, m_channelFlags, m_conversionFlags, m_displayFilter, m_monitorColorSpace, m_monitorProfile, m_onlyOneChannelSelected, m_originalImage, m_pyramid, m_renderingIntent, m_selectedChannelIndex, m_useOcio, ORIGINAL_INDEX, KoColorSpace::pixelSize(), KoColorSpace::profile(), KisImage::projection(), KisPaintDevice::readBytes(), RGBAColorModelID, setChannelFlags(), and KisConfig::showSingleChannelAsColor().
|
overridevirtual |
Implements KisProjectionBackend.
Definition at line 117 of file kis_image_pyramid.cpp.
References KoColorSpace::channels, KoChannelInfo::COLOR, KisPaintDevice::colorSpace(), m_allChannelsSelected, m_channelFlags, m_onlyOneChannelSelected, m_originalImage, m_selectedChannelIndex, and KisImage::projection().
|
overridevirtual |
Implements KisProjectionBackend.
Definition at line 138 of file kis_image_pyramid.cpp.
References m_displayFilter.
|
overridevirtual |
Those methods are related to KisPrescaledProjection's equivalents
Implements KisProjectionBackend.
Definition at line 158 of file kis_image_pyramid.cpp.
References clearPyramid(), KisPaintDevice::exactBounds(), KisImage::height(), m_originalImage, KisImage::projection(), retrieveImageData(), setImageSize(), KisImageConfig::updatePatchHeight(), KisImageConfig::updatePatchWidth(), and KisImage::width().
|
overridevirtual |
Implements KisProjectionBackend.
Definition at line 199 of file kis_image_pyramid.cpp.
|
overridevirtual |
If you change pixel size here, don't forget to change it in optimized function downsamplePixels()
Implements KisProjectionBackend.
Definition at line 101 of file kis_image_pyramid.cpp.
References KoColorSpaceRegistry::instance(), m_conversionFlags, m_monitorColorSpace, m_monitorProfile, m_renderingIntent, rebuildPyramid(), and KoColorSpaceRegistry::rgb8().
|
overridevirtual |
Updates the cache of the backend by reading from an associated image. All data transfers with KisImage should happen here
Implements KisProjectionBackend.
Definition at line 206 of file kis_image_pyramid.cpp.
References retrieveImageData().
|
private |
Definition at line 126 of file kis_image_pyramid.h.
|
private |
Definition at line 125 of file kis_image_pyramid.h.
|
private |
Definition at line 115 of file kis_image_pyramid.h.
|
private |
Definition at line 112 of file kis_image_pyramid.h.
|
private |
Definition at line 110 of file kis_image_pyramid.h.
|
private |
Definition at line 109 of file kis_image_pyramid.h.
|
private |
Definition at line 127 of file kis_image_pyramid.h.
|
private |
Definition at line 107 of file kis_image_pyramid.h.
|
private |
Definition at line 106 of file kis_image_pyramid.h.
|
private |
|
private |
Definition at line 114 of file kis_image_pyramid.h.
|
private |
Definition at line 128 of file kis_image_pyramid.h.
|
private |
Definition at line 123 of file kis_image_pyramid.h.