Public Member Functions | Protected Member Functions | Protected Attributes

ImageWidget Class Reference

#include <ImageWidget.h>

List of all members.

Public Member Functions

 ImageWidget (QWidget *parent=0)
void setImage (QImage *image)
void setImage (IplImage *img)
void reset ()
void addRectange (CvRect &rect)

Protected Member Functions

void paintEvent (QPaintEvent *event)
QImage iplToQImage (IplImage *img, QImage *&dest)

Protected Attributes

QPen * rectPen
QImage * image
QList< QRect > rects

Detailed Description

Qt widget to display an OpenCV IplImage.


Constructor & Destructor Documentation

ImageWidget::ImageWidget ( QWidget *  parent = 0 )

Initializes the widget. A blank rectangle is drawn until an image is set.

Parameters:
parentParent widget

Member Function Documentation

void ImageWidget::addRectange ( CvRect &  rect )

Draws a rectangle on top of the image.

Note:
This method can be called multiple times in-between setImage() to draw multiple rectangles.
Parameters:
rectRectangle coordinates and size
QImage ImageWidget::iplToQImage ( IplImage *  img,
QImage *&  dest 
) [protected]

Converts an IplImage to a QImage

Parameters:
imgInput image
destDestination image
Returns:
Returns dest
void ImageWidget::paintEvent ( QPaintEvent *  event ) [protected]

Redraws the widget.

Note:
Do not call this method directly!
void ImageWidget::reset (  )

Removes the current image. This will result in a blank rectangle - similar to the constructor.

void ImageWidget::setImage ( QImage *  image )

Sets the image that should be displayed.

Note:
Internally, the IplImage is converted to a QImage
Parameters:
imgInput image
void ImageWidget::setImage ( IplImage *  img )

Sets the image that should be displayed.

Parameters:
imginput image.

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Defines