2 #ifndef __libquark_gui_ImageViewerPanel_hxx 3 #define __libquark_gui_ImageViewerPanel_hxx 10 #include <QRubberBand> 51 {
return(_pixmap.width()); }
58 {
return(_pixmap.height()); }
69 {
return(_scaleFactor); }
103 void crop(
const QRect &rect);
125 static const float ZOOM_FACTOR;
129 QRubberBand *_selection;
131 bool _allowSelection;
137 #endif // __libquark_gui_ImageViewerPanel_hxx void zoomReset()
Resets the scale factor to 1.0.
QPixmap image() const
Returns the image that is currently displayed by the widget.
Definition: ImageViewerPanel.h++:43
void rotateRight()
Rotates the image 90 degrees clockwise.
void zoomScaleChanged(float scale)
Emitted when the zoom scale factor changes.
void zoomToFit(const QRect &rect)
Zooms the image so that it fits optimally within the given rectangle.
void zoomIn()
Zooms the image in.
void setImage(QPixmap pixmap)
Sets the image to be displayed by the widget.
A widget for displaying an image, with support for zooming, rotation, selection, and cropping...
Definition: ImageViewerPanel.h++:21
int imageHeight() const
Returns the height, in pixels, of the image that is currently displayed by the widget.
Definition: ImageViewerPanel.h++:57
int imageWidth() const
Returns the width, in pixels, of the image that is currently displayed by the widget.
Definition: ImageViewerPanel.h++:50
virtual void mousePressEvent(QMouseEvent *event)
void crop(const QRect &rect)
Crops the image to the specified region.
virtual void mouseMoveEvent(QMouseEvent *event)
void setAllowSelection(bool allowSelection)
Enables or disables selection.
Definition: BarChartView.h++:6
virtual ~ImageViewerPanel()
Destructor.
float scaleFactor() const
Returns the current scale factor.
Definition: ImageViewerPanel.h++:68
void clearSelection()
Clears the selection, if any.
QRect selection() const
Returns the current selection, or an empty rectangle if there is none.
void zoomOut()
Zooms the image out.
ImageViewerPanel(QWidget *parent=NULL)
Constructs a new ImageViewerPanel.
void rotateLeft()
Rotates the image 90 degrees counterclockwise.
void imageSizeChanged(QSize size)
Emitted when the size of the image changes.