Krita Source Code Documentation
Loading...
Searching...
No Matches
Canvas.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_CANVAS_H
7#define LIBKIS_CANVAS_H
8
9#include <QObject>
10
11#include "kritalibkis_export.h"
12#include "libkis.h"
13
14class KoCanvasBase;
16class KoZoomState;
17
23class KRITALIBKIS_EXPORT Canvas : public QObject
24{
25 Q_OBJECT
26
27public:
29 {
30 ZOOM_CONSTANT = 0, // zoom x %
31 ZOOM_PAGE = 1, // zoom to page
32 ZOOM_WIDTH = 2, // zoom to width
33 ZOOM_HEIGHT = 16, // zoom to height
34 };
35
36 explicit Canvas(KoCanvasBase *canvas, QObject *parent = 0);
37 ~Canvas() override;
38
39 bool operator==(const Canvas &other) const;
40 bool operator!=(const Canvas &other) const;
41
42public Q_SLOTS:
43
47 qreal zoomLevel() const;
48
52 void setZoomLevel(qreal value);
53
57 void setPreferredCenter(const QPointF& imagePos);
58
62 QPointF preferredCenter() const;
63
67 void pan(const QPoint& offset);
68
72 void resetZoom();
73
77 qreal rotation() const;
78
82 void setRotation(qreal angle);
83
87 void resetRotation();
88
92 bool mirror() const;
93
97 void setMirror(bool value);
98
103 bool wrapAroundMode() const;
104
108 void setWrapAroundMode(bool enable);
109
114 bool levelOfDetailMode() const;
115
119 void setLevelOfDetailMode(bool enable);
120
124 View *view() const;
125
126private Q_SLOTS:
127 void emitZoomStateChanged(const KoZoomState &zoomState);
128
129Q_SIGNALS:
130
134void removed();
135
141
146void cursorPositionChanged(const QPoint &position);
147
155void documentCursorPositionChanged(const QPointF &position);
156
161void sizeChanged(const QSize &size);
162
169void documentOffsetChanged(const QPointF &oldOffset, const QPointF &newOffset);
170
177void effectiveZoomChanged(qreal effectiveZoom);
178
187void zoomStateChanged(const ZoomMode zoomMode, qreal zoom, qreal minZoom, qreal maxZoom);
188
194void documentRectInWidgetPixelsChanged(const QRectF &documentRectInWidgetPixels);
195
200void rotationChanged(qreal angle);
201
207void mirrorChanged(bool mirrorX, bool mirrorY);
208
213
214private:
215
216 friend class ManagedColor;
217
218 KisDisplayColorConverter *displayColorConverter() const;
219
220 struct Private;
221 Private *const d;
222
223};
224
225#endif // LIBKIS_CANVAS_H
float value(const T *src, size_t ch)
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
void stateChanged()
ZoomMode
Definition Canvas.h:29
void zoomStateChanged(const ZoomMode zoomMode, qreal zoom, qreal minZoom, qreal maxZoom)
void removed()
void documentRectInWidgetPixelsChanged(const QRectF &documentRectInWidgetPixels)
void effectiveZoomChanged(qreal effectiveZoom)
void offsetChanged()
void documentCursorPositionChanged(const QPointF &position)
void sizeChanged(const QSize &size)
void documentOffsetChanged(const QPointF &oldOffset, const QPointF &newOffset)
Private *const d
Definition Canvas.h:221
void cursorPositionChanged(const QPoint &position)
void rotationChanged(qreal angle)
void mirrorChanged(bool mirrorX, bool mirrorY)
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color...
Definition View.h:25