|
Krita Source Code Documentation
|
#include <Canvas.h>
Inheritance diagram for Canvas:Public Types | |
| enum | ZoomMode { ZOOM_CONSTANT = 0 , ZOOM_PAGE = 1 , ZOOM_WIDTH = 2 , ZOOM_HEIGHT = 16 } |
Public Slots | |
| bool | levelOfDetailMode () const |
| bool | mirror () const |
| void | pan (const QPoint &offset) |
| pan the current view in pixels. | |
| QPointF | preferredCenter () const |
| void | resetRotation () |
| resetRotation reset the canvas rotation. | |
| void | resetZoom () |
| resetZoom set the zoomlevel to 100% | |
| qreal | rotation () const |
| void | setLevelOfDetailMode (bool enable) |
| setLevelOfDetailMode sets Instant Preview to | |
| void | setMirror (bool value) |
| setMirror turn the canvas mirroring on or off depending on | |
| void | setPreferredCenter (const QPointF &imagePos) |
setPan Centers the image pixel at imagePos in the current view | |
| void | setRotation (qreal angle) |
| setRotation set the rotation of the canvas to the given | |
| void | setWrapAroundMode (bool enable) |
| setWrapAroundMode set wraparound mode to | |
| void | setZoomLevel (qreal value) |
setZoomLevel set the zoomlevel to the given value. 1.0 is 100%. | |
| View * | view () const |
| bool | wrapAroundMode () const |
| qreal | zoomLevel () const |
Signals | |
| void | cursorPositionChanged (const QPoint &position) |
| void | documentCursorPositionChanged (const QPointF &position) |
| void | documentOffsetChanged (const QPointF &oldOffset, const QPointF &newOffset) |
| void | documentRectInWidgetPixelsChanged (const QRectF &documentRectInWidgetPixels) |
| void | effectiveZoomChanged (qreal effectiveZoom) |
| void | mirrorChanged (bool mirrorX, bool mirrorY) |
| void | offsetChanged () |
| void | removed () |
| void | rotationChanged (qreal angle) |
| void | sizeChanged (const QSize &size) |
| void | stateChanged () |
| void | zoomStateChanged (const ZoomMode zoomMode, qreal zoom, qreal minZoom, qreal maxZoom) |
Public Member Functions | |
| Canvas (KoCanvasBase *canvas, QObject *parent=0) | |
| bool | operator!= (const Canvas &other) const |
| bool | operator== (const Canvas &other) const |
| ~Canvas () override | |
Private Slots | |
| void | emitZoomStateChanged (const KoZoomState &zoomState) |
Private Member Functions | |
| KisDisplayColorConverter * | displayColorConverter () const |
Private Attributes | |
| Private *const | d |
Friends | |
| class | ManagedColor |
Canvas wraps the canvas inside a view on an image/document. It is responsible for the view parameters of the document: zoom, rotation, mirror, wraparound and instant preview.
| enum Canvas::ZoomMode |
|
explicit |
Definition at line 21 of file Canvas.cpp.
References krita::Canvas::Private::canvas, krita::Canvas::Private::canvasControllerProxy, cursorPositionChanged(), d, documentCursorPositionChanged(), documentOffsetChanged(), documentRectInWidgetPixelsChanged(), effectiveZoomChanged(), emitZoomStateChanged(), KisCanvas2::imageView(), mirrorChanged(), offsetChanged(), removed(), rotationChanged(), sizeChanged(), stateChanged(), and zoomStateChanged().
|
override |
|
signal |
Emitted when the cursor is moved over the canvas widget.
| position | the position in view coordinates (pixels). |
|
private |
Definition at line 149 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::displayColorConverter.
|
signal |
Emitted when the cursor is moved over the canvas widget.
| position | the position in document coordinates. |
Use cursorPositionChanged to get the position in view coordinates.
|
signal |
Emitted whenever the canvas is panned.
| point | the new top-left point from which the document should be drawn. |
|
signal |
Emitted whenever the document's position or size within the viewport widget changes.
| documentRectInWidgetPixels | rect with position of documentOffset and size of document size * effective zoom. |
|
signal |
Emitted whenever the effective zoom level changes.
| effectiveZoom | In pixel size display mode, zoom * 1 / display scaling. In print size display mode, zoom * display DPI / image PPI. |
|
privateslot |
Definition at line 179 of file Canvas.cpp.
References KoZoomState::maxZoom, KoZoomState::minZoom, KoZoomState::mode, KoZoomState::zoom, and zoomStateChanged().
|
slot |
Definition at line 167 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
Definition at line 130 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
signal |
Emitted when mirrored status changes.
| mirrorX | whether the canvas's view is mirrored horizontally (reversed) |
| mirrorY | whether the canvas's view is mirrored vertically (inverted) |
|
signal |
Emitted when the canvas is panned. See documentOffsetChanged
| bool Canvas::operator!= | ( | const Canvas & | other | ) | const |
| bool Canvas::operator== | ( | const Canvas & | other | ) | const |
Definition at line 51 of file Canvas.cpp.
References krita::Canvas::Private::canvas, and d.
|
slot |
pan the current view in pixels.
Definition at line 99 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
Definition at line 86 of file Canvas.cpp.
References krita::Canvas::Private::canvas, KisCanvas2::coordinatesConverter, d, KisCoordinatesConverter::documentToImage(), KisCoordinatesConverter::flakeToDocument(), and KisCanvas2::imageView().
|
signal |
Emitted when the canvas is about to be removed.
|
slot |
resetRotation reset the canvas rotation.
Definition at line 111 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
resetZoom set the zoomlevel to 100%
Definition at line 104 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
Definition at line 117 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
signal |
Emitted when rotation changes.
| angle | the angle in degrees |
|
slot |
setLevelOfDetailMode sets Instant Preview to
| enable |
Definition at line 173 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
setMirror turn the canvas mirroring on or off depending on
| value |
Definition at line 136 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, KisCanvas2::imageView(), and value().
|
slot |
setPan Centers the image pixel at imagePos in the current view
Definition at line 74 of file Canvas.cpp.
References krita::Canvas::Private::canvas, KisCanvas2::coordinatesConverter, d, KisCoordinatesConverter::documentToFlake(), KisCoordinatesConverter::imageToDocument(), and KisCanvas2::imageView().
|
slot |
setRotation set the rotation of the canvas to the given
| angle | in degrees. |
Definition at line 123 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, KisCanvas2::imageView(), and rotation().
|
slot |
setWrapAroundMode set wraparound mode to
| enable |
Definition at line 161 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
setZoomLevel set the zoomlevel to the given value. 1.0 is 100%.
Definition at line 68 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, KisCanvas2::imageView(), value(), and KoZoomMode::ZOOM_CONSTANT.
|
signal |
Emitted when the viewport size changes.
| size | the size in widget pixels. |
|
signal |
Emitted when this canvas's zoom, rotation, mirror, offset, or viewport change.
|
slot |
Definition at line 142 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, KisCanvas2::imageView(), and view().
|
slot |
Definition at line 155 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
slot |
Definition at line 62 of file Canvas.cpp.
References krita::Canvas::Private::canvas, d, and KisCanvas2::imageView().
|
signal |
Emitted whenever the zoom state changes.
| zoomMode | ZoomMode |
| zoom | zoom level, 1.0 is 100% |
| minZoom | the minimum allowed zoom level |
| maxZoom | the maximum allowed zoom level |
|
friend |