Krita
7 #include <KoCanvasBase.h>
8 #include <kis_canvas2.h>
10 #include <KoCanvasController.h>
11 #include <kis_canvas_controller.h>
12 #include <kis_zoom_manager.h>
16 struct Canvas::Private {
18 KisCanvas2 *canvas {0};
21 Canvas::Canvas(KoCanvasBase *canvas,
QObject *parent)
25 d->canvas =
static_cast<KisCanvas2*
>(canvas);
34 bool Canvas::operator==(
const Canvas &other)
const
36 return (d->canvas == other.d->canvas);
39 bool Canvas::operator!=(
const Canvas &other)
const
41 return !(operator==(other));
47 if (!d->canvas)
return 1.0;
48 return d->canvas->imageView()->zoomManager()->zoom();
53 if (!d->canvas)
return;
54 d->canvas->imageView()->zoomController()->setZoom(KoZoomMode::ZOOM_CONSTANT, value);
59 if (!d->canvas)
return;
60 d->canvas->imageView()->zoomManager()->zoomTo100();
66 if (!d->canvas)
return;
67 d->canvas->imageView()->canvasController()->resetCanvasRotation();
72 if (!d->canvas)
return 0;
73 return d->canvas->imageView()->canvasController()->rotation();
78 if (!d->canvas)
return;
79 d->canvas->imageView()->canvasController()->rotateCanvas(angle -
rotation());
85 if (!d->canvas)
return false;
86 return d->canvas->imageView()->canvasIsMirrored();
91 if (!d->canvas)
return;
92 d->canvas->imageView()->canvasController()->mirrorCanvas(value);
97 if (!d->canvas)
return 0;
102 KisDisplayColorConverter *Canvas::displayColorConverter()
const
104 if (!d->canvas)
return 0;
105 return d->canvas->displayColorConverter();
110 if (!d->canvas)
return false;
111 return d->canvas->imageView()->canvasController()->wrapAroundMode();
116 if (!d->canvas)
return;
117 d->canvas->imageView()->canvasController()->slotToggleWrapAroundMode(enable);
122 if (!d->canvas)
return false;
123 return d->canvas->imageView()->canvasController()->levelOfDetailMode();
128 if (!d->canvas)
return;
129 return d->canvas->imageView()->canvasController()->slotToggleLevelOfDetailMode(enable);
132 #include "moc_Canvas.cpp"
void resetZoom()
resetZoom set the zoomlevel to 100%
void setRotation(qreal angle)
setRotation set the rotation of the canvas to the given
bool wrapAroundMode() const
bool levelOfDetailMode() const
View represents one view on a document.
void setZoomLevel(qreal value)
setZoomLevel set the zoomlevel to the given value.
void resetRotation()
resetRotation reset the canvas rotation.
void setWrapAroundMode(bool enable)
setWrapAroundMode set wraparound mode to
void setMirror(bool value)
setMirror turn the canvas mirroring on or off depending on
Canvas wraps the canvas inside a view on an image/document.
void setLevelOfDetailMode(bool enable)
setLevelOfDetailMode sets Instant Preview to
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:07:02 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.