Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_image_patch.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_IMAGE_PATCH_H_
8#define KIS_IMAGE_PATCH_H_
9
10#include <QPainter>
11#include <QImage>
12#include <kis_types.h>
13
14#define BORDER_SIZE(scale) (ceil(0.5/scale))
15
16
18{
19public:
24
32 KisImagePatch(QRect imageRect, qint32 borderWidth,
33 qreal scaleX, qreal scaleY);
34
40 void setImage(QImage image);
41
47 void preScale(const QRectF &dstRect);
48
55 QRect patchRect();
56
62 void drawMe(QPainter &gc,
63 const QRectF &dstRect,
64 QPainter::RenderHints renderHints);
65
69 bool isValid();
70
71private:
75 qreal m_scaleX {0.0};
76 qreal m_scaleY {0.0};
77
83
94
95 QImage m_image;
96 bool m_isScaled {false};
97};
98
99#endif /* KIS_IMAGE_PATCH_H_ */
void preScale(const QRectF &dstRect)
void drawMe(QPainter &gc, const QRectF &dstRect, QPainter::RenderHints renderHints)
void setImage(QImage image)