|
Krita Source Code Documentation
|
#include <kis_image_patch.h>
Public Member Functions | |
| void | drawMe (QPainter &gc, const QRectF &dstRect, QPainter::RenderHints renderHints) |
| bool | isValid () |
| KisImagePatch () | |
| KisImagePatch (QRect imageRect, qint32 borderWidth, qreal scaleX, qreal scaleY) | |
| QRect | patchRect () |
| void | preScale (const QRectF &dstRect) |
| void | setImage (QImage image) |
Private Attributes | |
| QImage | m_image |
| QRectF | m_interestRect |
| bool | m_isScaled {false} |
| QRect | m_patchRect |
| qreal | m_scaleX {0.0} |
| qreal | m_scaleY {0.0} |
Definition at line 17 of file kis_image_patch.h.
| KisImagePatch::KisImagePatch | ( | ) |
A default constructor initializing invalid patch
Definition at line 44 of file kis_image_patch.cpp.
| KisImagePatch::KisImagePatch | ( | QRect | imageRect, |
| qint32 | borderWidth, | ||
| qreal | scaleX, | ||
| qreal | scaleY ) |
Initializes a new patch with given values. Be careful, because the constructor does not fill QImage of the patch, as the patch rect is not known yet
Definition at line 48 of file kis_image_patch.cpp.
References dbgRender, m_interestRect, m_patchRect, ppVar, and scaleRect().
| void KisImagePatch::drawMe | ( | QPainter & | gc, |
| const QRectF & | dstRect, | ||
| QPainter::RenderHints | renderHints ) |
Draws an m_interestRect of the patch onto gc By the way it fits this rect into dstRect renderHints are directly transmitted to QPainter
Definition at line 109 of file kis_image_patch.cpp.
References dbgRender, m_image, m_interestRect, m_patchRect, and ppVar.
| bool KisImagePatch::isValid | ( | ) |
Checks whether the patch can be used for drawing the image
Definition at line 104 of file kis_image_patch.cpp.
References m_image.
| QRect KisImagePatch::patchRect | ( | ) |
Returns the rect of KisImage covered by the image of the patch (in KisImage pixels)
Definition at line 99 of file kis_image_patch.cpp.
References m_patchRect.
| void KisImagePatch::preScale | ( | const QRectF & | dstRect | ) |
prescale the patch image. Call after setImage(). This ensures that we use the QImage smoothscale method, not the QPainter scaling, which is far inferior.
Definition at line 75 of file kis_image_patch.cpp.
References m_image, m_interestRect, m_isScaled, m_scaleX, m_scaleY, and scaleRect().
| void KisImagePatch::setImage | ( | QImage | image | ) |
Sets the image of the patch Should be called right after the constructor to finish initializing the object
Definition at line 69 of file kis_image_patch.cpp.
References m_image, and m_isScaled.
|
private |
Definition at line 95 of file kis_image_patch.h.
|
private |
The rect that was requested during creation of the patch. It equals to patchRect without borders These borders are introduced for more accurate smooth scaling to reduce border effects (IN m_image PIXELS, relative to m_image's topLeft);
Definition at line 93 of file kis_image_patch.h.
|
private |
Definition at line 96 of file kis_image_patch.h.
|
private |
The rect of KisImage covered by the image of the patch (in KisImage pixels)
Definition at line 82 of file kis_image_patch.h.
|
private |
The scale of the image stored in the patch
Definition at line 75 of file kis_image_patch.h.
|
private |
Definition at line 76 of file kis_image_patch.h.