5 #ifndef CNOID_BASE_IMAGE_WIDGET_H
6 #define CNOID_BASE_IMAGE_WIDGET_H
12 #include "exportdecl.h"
23 explicit ImageWidget(QWidget* parent =
nullptr, Qt::WindowFlags f = Qt::WindowFlags());
26 void setPixmap(
const QPixmap& pixmap);
27 void setImage(
const Image& image);
28 void setImage(
const QImage& image);
30 void setScalingEnabled(
bool on);
31 bool isScalingEnabled()
const;
33 void zoom(
double scale);
34 void translate(QPoint pos);
36 bool getTransform(QTransform& transform);
38 void setTransform(
const QTransform& transform);
39 void setAngle(
double angle);
40 void rotate(
double angle);
47 virtual void paintEvent(QPaintEvent* event);
48 virtual QSize sizeHint()
const;
49 virtual void resizeEvent(QResizeEvent *event);
53 bool isScalingEnabled_;
54 QTransform transform_;
55 QTransform notScaledTransform_;
56 QTransform initialTransform_;
57 Image transformedImage;
60 void resize(
const QSize& size);