#include <qvgui/qvimagecanvas.h>
Inherits QVPropertyContainer.
Public Slots | |
void | rectSelectedSlot (QRect rect) |
void | polySelectedSlot (QPoint point, bool reset, TPolyMode mode) |
void | circleSelectedSlot (QPoint center, float radius) |
Public Member Functions | |
QVImageCanvas (const QString name=QString(), QWidget *parent=0) | |
bool | linkProperty (QVWorker &worker, const QString propertyName, QColor color=Qt::red, bool printTags=false) |
bool | linkROI (QVWorker *worker, const QString propertyName) |
bool | linkPolyline (QVWorker *worker, const QString propertyName) |
bool | unlink (QVWorker *worker, const QString propertyName) |
void | setLowHigh (float low, float high) |
virtual void | custom_viewer () |
When created an object derived from this class, the interface opens a window that depicts the content of a property of type QVImage contained in a property holder (normally a QVWorker object).
Usage is as follows: first create a QVImageCanvas object in the main() function of a program, then link a QVImage type property from a property holder:
[...] CannyWorker cannyWorker("Canny"); [...] QVImageCanvas imageCanvas; imageCanvas.linkProperty(cannyWorker,"Canny image"); [...]
and latter call for the exec() function of the QVApplication object of the program. This will automatically create a window like the following:
You can see it has a zoom number indicator (z = 1), horizontal and vertical rules (in pixels), and some buttons. These latter control zooming and moving around a zoomed area of the image mostly, and a detailed explanation of each one follows:
Zoom in button ![]() | This button zooms the image in. Canvas window doesn't change size, but the area of the image displayed becomes smaller by a factor of 4 (width and height gets divided by 2). The label of the left bottom corner displays the text z=<zoom>
|
---|---|
Zoom out button ![]() | This button divides zoom factor by 2, if it is equal or greater than 2. If the canvas window is bigger than the image at the final zoom, it is adjusted to the size of the latter.
|
Zoom restore button ![]() | This button sets zoom factor by 1, and resizes canvas window to its original size.
|
Select zoom region button ![]() | This button lets you select a rectangle in the image to zoom, adjusting zoom factor and canvas window size to it.
|
Select polyline button ![]() | This button lets you select points in the image. That points list can be get as the "poly select" imageCanvas's property. You can explain this button by pushing it for a few seconds, and you can select a polyline representation, a point list representation, or generate a circular polyline, by a click and drag mode.
|
Select ROI button ![]() | This button lets you select a rectangle in the image, that rectangle can be get as the "rect select" imageCanvas's property. And can be use to apply operations only to this rectangle.
|
Drag mode ![]() | This button activates drag mode. With it you can move around the image displayed in the canvas window, if the zoom factor forces the canvas window to show only a sub-region of the image, by holding click and dragging over the depicted image. |
In the following figure you can see a zoomed canvas window depicting a sub-region of the original image:
Another interesting feature of image canvas is that at a zoom factor bigger or equal to 32, the canvas renders the gray-scale pixel value over every pixel if the image is gray-scale, or the three different values for each of the RGB channels over every pixel, if the image is RGB, as depicted below:
Definition at line 105 of file qvimagecanvas.h.
void QVImageCanvas::circleSelectedSlot | ( | QPoint | center, | |
float | radius | |||
) | [slot] |
¿Cuantos puntos debe contener la polilínea de la circunferencia, uno por pixel o menos? -> Hacer concilio
Definition at line 335 of file qvimagecanvas.cpp.