MIRA
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()

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

◆ ~ImgWidget()

~ImgWidget ( )

Member Function Documentation

◆ setImage() [1/3]

void setImage ( const Img<> &  image)

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

◆ setImage() [2/3]

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)

◆ setColormap()

void setColormap ( const Colormap map)

Sets a colormap for coloring single channel images.

◆ clearColormap()

void clearColormap ( )

◆ getContentWidget()

QWidget* getContentWidget ( )

Get the Widget containing the Pixmap.

◆ setAutoResize()

void setAutoResize ( bool  autoResize)

enable automatic resizing to content.

◆ setAutoScale()

void setAutoScale ( bool  autoScale)

enable automatic scaling of the image.

◆ enableScroll()

void enableScroll ( bool  enable)

enables scrollbars

◆ setMouseListener()

void setMouseListener ( IMouseListener listener)

Sets a mouse listener.

◆ mousePressEvent()

virtual void mousePressEvent ( QMouseEvent *  e)
protectedvirtual

◆ contentsMousePressEvent()

void contentsMousePressEvent ( QMouseEvent *  e)
protected

◆ resizeEvent()

void resizeEvent ( QResizeEvent *  event)
protected

◆ setImage() [3/3]

void setImage ( )
protected

◆ setImageScaledToSize()

void setImageScaledToSize ( )
protected

Member Data Documentation

◆ mLayout

QLayout* mLayout
protected

◆ mScrollArea

QScrollArea* mScrollArea
protected

◆ mContentWidget

ImgPainterWidget* mContentWidget
protected

◆ mAutoResize

bool mAutoResize
protected

◆ mAutoScale

bool mAutoScale
protected

◆ mCurrentImage

QImage mCurrentImage
protected

◆ mColorTable

QVector<QRgb> mColorTable
protected

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