MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ImgWidget Class Reference

A widget that visualizes an Img. More...

#include <widgets/ImgWidget.h>

Inheritance diagram for ImgWidget:
Inheritance graph
[legend]

Classes

class  IMouseListener
 The mouse listener interface that can be implemented to react on user interaction. More...
 

Public Member Functions

 ImgWidget (QWidget *parent=0, bool enableScroll=true)
 
 ~ImgWidget ()
 
void setImage (const Img<> &image)
 Set image. Use this for 8bit images (single or multi channel). More...
 
void setImage (const Img<> &image, double scaleMin, double scaleMax)
 Set image. More...
 
void setColormap (const Colormap &map)
 Sets a colormap for coloring single channel images. More...
 
void clearColormap ()
 
QWidget * getContentWidget ()
 Get the Widget containing the Pixmap. More...
 
void setAutoResize (bool autoResize)
 enable automatic resizing to content. More...
 
void setAutoScale (bool autoScale)
 enable automatic scaling of the image. More...
 
void enableScroll (bool enable)
 enables scrollbars More...
 
Mouse interaction support
void setMouseListener (IMouseListener *listener)
 Sets a mouse listener. More...
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *e)
 
void contentsMousePressEvent (QMouseEvent *e)
 
void resizeEvent (QResizeEvent *event)
 
void setImage ()
 
void setImageScaledToSize ()
 

Protected Attributes

QLayout * mLayout
 
QScrollArea * mScrollArea
 
ImgPainterWidget * mContentWidget
 
bool mAutoResize
 
bool mAutoScale
 
QImage mCurrentImage
 
QVector< QRgb > mColorTable
 

Detailed Description

A widget that visualizes an Img.

Optionally, a mouse handler can be specified to react on user interaction with the image.

Constructor & Destructor Documentation

ImgWidget ( QWidget *  parent = 0,
bool  enableScroll = true 
)
~ImgWidget ( )

Member Function Documentation

void setImage ( const Img<> &  image)

Set image. Use this for 8bit images (single or multi channel).

void setImage ( const Img<> &  image,
double  scaleMin,
double  scaleMax 
)

Set image.

Use this for 16/32/64 bit images, where raw image values need to be mapped to (0,255)

void setColormap ( const Colormap map)

Sets a colormap for coloring single channel images.

void clearColormap ( )
QWidget* getContentWidget ( )

Get the Widget containing the Pixmap.

void setAutoResize ( bool  autoResize)

enable automatic resizing to content.

void setAutoScale ( bool  autoScale)

enable automatic scaling of the image.

void enableScroll ( bool  enable)

enables scrollbars

void setMouseListener ( IMouseListener listener)

Sets a mouse listener.

virtual void mousePressEvent ( QMouseEvent *  e)
protectedvirtual
void contentsMousePressEvent ( QMouseEvent *  e)
protected
void resizeEvent ( QResizeEvent *  event)
protected
void setImage ( )
protected
void setImageScaledToSize ( )
protected

Member Data Documentation

QLayout* mLayout
protected
QScrollArea* mScrollArea
protected
ImgPainterWidget* mContentWidget
protected
bool mAutoResize
protected
bool mAutoScale
protected
QImage mCurrentImage
protected
QVector<QRgb> mColorTable
protected

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