#include <qvgui/qvimagecanvas.h>
Inherits QVPropertyContainer.
Public Member Functions | |
QVImageCanvas (const QString name=QString(), QWidget *parent=0) | |
void | linkProperty (QVWorker &worker, const QString propertyName) |
void | setLowHigh (float low, float high) |
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 botton 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.
|
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 subregion 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 subregion 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 88 of file qvimagecanvas.h.