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>
16struct Canvas::Private {
18 KisCanvas2 *canvas {0};
21Canvas::Canvas(KoCanvasBase *canvas,
QObject *parent)
25 d->canvas =
static_cast<KisCanvas2*
>(canvas);
34bool Canvas::operator==(
const Canvas &other)
const
36 return (d->canvas == other.d->canvas);
39bool 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;
102KisDisplayColorConverter *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"
Canvas wraps the canvas inside a view on an image/document.
void setMirror(bool value)
setMirror turn the canvas mirroring on or off depending on
void setRotation(qreal angle)
setRotation set the rotation of the canvas to the given
void setWrapAroundMode(bool enable)
setWrapAroundMode set wraparound mode to
bool levelOfDetailMode() const
void setLevelOfDetailMode(bool enable)
setLevelOfDetailMode sets Instant Preview to
void resetRotation()
resetRotation reset the canvas rotation.
bool wrapAroundMode() const
void setZoomLevel(qreal value)
setZoomLevel set the zoomlevel to the given value.
void resetZoom()
resetZoom set the zoomlevel to 100%
View represents one view on a document.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:09 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.