Logo Search packages:      
Sourcecode: scantailor version File versions  Download package

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes

ImageViewBase Class Reference

The base class for widgets that display and manipulate images. More...

#include <ImageViewBase.h>

Inheritance diagram for ImageViewBase:
Inheritance graph
Collaboration diagram for ImageViewBase:
Collaboration graph

List of all members.


class  HqTransformTask
class  TempFocalPointAdjuster
 Temporarily adjust the widget focal point, then change it back. More...
class  TransformChangeWatcher

Public Types

enum  FocalPointMode { CENTER_IF_FITS, DONT_CENTER }

Public Member Functions

void adjustAndSetWidgetFocalPoint (QPointF const &widget_fp)
 Set the focal point in widget coordinates, after adjustring it to avoid wasting of widget space.
QPixmap const & downscaledPixmap () const
void ensureStatusTip (QString const &status_tip)
 A better version of setStatusTip().
QRectF getOccupiedWidgetRect () const
QPointF getWidgetFocalPoint () const
 Get the focal point in widget coordinates.
void hqTransformSetEnabled (bool enabled)
 Enable or disable the high-quality transform.
QTransform const & imageToVirtual () const
QTransform imageToWidget () const
 ImageViewBase (QImage const &image, ImagePixmapUnion const &downscaled_version, ImagePresentation const &presentation, Margins const &margins=Margins())
 ImageViewBase constructor.
InteractionStateinteractionState ()
InteractionState const & interactionState () const
void moveTowardsIdealPosition (double pixel_length)
InteractionHandlerrootInteractionHandler ()
void setWidgetFocalPoint (QPointF const &widget_fp)
 Set the focal point in widget coordinates.
void setWidgetFocalPointWithoutMoving (QPointF new_widget_fp)
 Sets the widget focal point and recalculates the pixmap focal focal point so that the image is not moved on screen.
void setZoomLevel (double zoom)
 Sets the zoom level.
void update ()
void updateTransform (ImagePresentation const &presentation)
 Updates image-to-virtual and recalculates virtual-to-widget transformations.
void updateTransformAndFixFocalPoint (ImagePresentation const &presentation, FocalPointMode mode)
 Same as updateTransform(), but adjusts the focal point to improve screen space usage.
void updateTransformPreservingScale (ImagePresentation const &presentation)
 Same as updateTransform(), but preserves the visual image scale.
QRectF const & virtualDisplayRect () const
QTransform const & virtualToImage () const
QTransform const & virtualToWidget () const
QTransform widgetToImage () const
QTransform const & widgetToVirtual () const
double zoomLevel () const
 Returns the current zoom level.

Static Public Member Functions

static BackgroundExecutorbackgroundExecutor ()
static QImage createDownscaledImage (QImage const &image)
 A stand-alone function to create a downscaled image to be passed to the constructor.

Protected Member Functions

virtual void contextMenuEvent (QContextMenuEvent *event)
virtual void enterEvent (QEvent *event)
virtual void keyPressEvent (QKeyEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
QRectF maxViewportRect () const
virtual void mouseMoveEvent (QMouseEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void mouseReleaseEvent (QMouseEvent *event)
virtual void paintEvent (QPaintEvent *event)
virtual void resizeEvent (QResizeEvent *event)
virtual void wheelEvent (QWheelEvent *event)

Private Slots

void initiateBuildingHqVersion ()
void reactToScrollBars ()
void updateScrollBars ()

Private Member Functions

void adjustAndSetNewWidgetFP (QPointF proposed_widget_fp, bool update=false)
QPointF centeredWidgetFocalPoint () const
QRectF dynamicViewportRect () const
QPointF getIdealWidgetFocalPoint (FocalPointMode mode) const
void hqVersionBuilt (QPoint const &origin, QImage const &image)
void maybeQueueRedraw ()
void scheduleHqVersionRebuild ()
void setNewWidgetFP (QPointF widget_fp, bool update=false)
void transformChanged ()
void updateCursor ()
void updateStatusTip ()
void updateStatusTipAndCursor ()
void updateWidgetTransform ()
void updateWidgetTransformAndFixFocalPoint (FocalPointMode mode)
bool validateHqPixmap () const

Private Attributes

QPixmap m_hqPixmap
QPoint m_hqPixmapPos
qint64 m_hqSourceId
bool m_hqTransformEnabled
QTransform m_hqXform
int m_ignoreResizeEvents
int m_ignoreScrollEvents
QImage m_image
QTransform m_imageToVirtual
InteractionState m_interactionState
QSize m_lastMaximumViewportSize
Margins m_margins
QPixmap m_pixmap
QPointF m_pixmapFocalPoint
QTransform m_pixmapToImage
QTransform m_potentialHqXform
IntrusivePtr< HqTransformTaskm_ptrHqTransformTask
InteractionHandler m_rootInteractionHandler
QTransform m_scrollTransform
QTimer m_timer
int m_transformChangeWatchersActive
QRectF m_virtualDisplayArea
QPolygonF m_virtualImageCropArea
QTransform m_virtualToImage
QTransform m_virtualToWidget
QPointF m_widgetFocalPoint
QTransform m_widgetToVirtual
double m_zoom

Detailed Description

The base class for widgets that display and manipulate images.

This class operates with 3 coordinate systems:

See also:
m_pixmapToImage, m_imageToVirt, m_virtualToWidget, m_widgetToVirtual.

Definition at line 60 of file ImageViewBase.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index