Image view item for QML. More...
#include <cvb/ui/image_view_item.hpp>
Inherits QQuickPaintedItem.
Public Slots | |
void | Refresh () |
Refresh the currently shared image. More... | |
Public Member Functions | |
Q_INVOKABLE bool | TryZoomIn () |
Tries to zoom in. More... | |
Q_INVOKABLE bool | TryZoomOut () |
Tries to zoom out. More... | |
Q_INVOKABLE bool | TryTranslate (const QPointF &translation) |
Tries to translate the target rectangle to a give point. More... | |
Q_INVOKABLE QPointF | MapViewToTarget (const QPointF &viewPoint) const |
Maps a point from the view rectangle to the target rect. More... | |
Q_INVOKABLE QPointF | MapTargetToSource (const QPointF &targetPoint) const |
Maps a point from the target rectangle to the source rect. More... | |
Q_INVOKABLE QPointF | MapSourceToImage (const QPointF &sourcePoint) const |
Maps a point from the source rectangle to the image rect. More... | |
Q_INVOKABLE QPointF | MapTargetToView (const QPointF &targetPoint) const |
Maps a point from the target rectangle to the view rectangle. More... | |
Q_INVOKABLE QPointF | MapSourceToTarget (const QPointF &sourcePoint) const |
Maps a point from the source rectangle to the target rectangle. More... | |
Q_INVOKABLE QPointF | MapImageToSource (const QPointF &imagePoint) const |
Maps a point from the image rectangle to the source rectangle. More... | |
Q_INVOKABLE QPointF | MapViewToImage (const QPointF &viewPoint) const |
Maps a point from the view rectangle to the image rectangle. More... | |
QRectF | ImageRect () const noexcept |
Get the rectangle described by the image buffer associated with the view. More... | |
QRectF | ViewRect () const noexcept |
Get the rectangle this items covers. More... | |
QRectF | TargetRect () const noexcept |
Get the rectangle inside the view rectangle the image is actually rendered to. More... | |
QRectF | SourceRect () const noexcept |
Get the rectangle inside the image rectangle that is actually rendered. More... | |
int | ZoomID () const |
Get the zoom identifier for special zoom steps (as integer, see Cvb::UI::ZoomID). More... | |
void | SetZoomID (int id) |
Set the zoom identifier for special zoom steps (as integer, see Cvb::UI::ZoomID). More... | |
double | ZoomFactor () const |
Get the view's zoom factor. More... | |
void | SetZoomFactor (double factor) |
Set the view's zoom factor. More... | |
void | SetImage (QObject *image) |
Set the image controller for this view item. More... | |
QPointF | ViewAnchor () const noexcept |
Get the reference point for mouse operations in view coordinates. More... | |
void | SetViewAnchor (const QPointF &viewAnchor) |
Set the reference point for mouse operations in view coordinates. More... | |
QPointF | ImageAnchor () const noexcept |
Get the reference point for mouse operations in image coordinates. More... | |
void | SetImageAnchor (const QPointF &imageAnchor) |
Set the reference point for mouse operations in image coordinates. More... | |
QVector< double > | HoverPixel () const |
The image pixel value the mouse is currently hovered over. More... | |
QPointF | HoverPosition () const noexcept |
Get the point the mouse is hovering over. More... | |
int | UploadMode () const noexcept |
Get the current upload mode (as integer, see Cvb::UI::UploadMode). More... | |
void | SetUploadMode (int uploadMode) |
Set the current upload mode (as integer). More... | |
Static Public Member Functions | |
template<class T > | |
static void | Register (const char *uri, int versionMajor, int versionMinor, const char *qmlName) |
Convenience method to register this type or a derived type in QML. More... | |
static void | Register () |
Convenience method to register this type in QML. More... | |
Image view item for QML.
This class (or an extended subclass) should be registered in QML. The item provides an image display. Instances should only be created from QML.
For convenience see ImageViewItem::Register
|
inline |
The image pixel value the mouse is currently hovered over.
Does | not throw any exception. |
If the value is undefined an empty vector is returned.
Use in QML as property: hoverPixel.
|
inlinenoexcept |
Get the point the mouse is hovering over.
Does | not throw any exception. |
Use in QML as property: hoverPos.
|
inlinenoexcept |
Get the reference point for mouse operations in image coordinates.
Does | not throw any exception. |
Use in QML as property: imageAnchor.
Get the rectangle described by the image buffer associated with the view.
Does | not throw any exception. |
Use in QML as property: imageRect.
Maps a point from the image rectangle to the source rectangle.
[in] | imagePoint | Point to map. |
Does | not throw any exception. |
Maps a point from the source rectangle to the image rect.
[in] | sourcePoint | Point to map. |
Does | not throw any exception. |
Maps a point from the source rectangle to the target rectangle.
[in] | sourcePoint | Point to map. |
Does | not throw any exception. |
Maps a point from the target rectangle to the source rect.
[in] | targetPoint | Point to map. |
Does | not throw any exception. |
Maps a point from the target rectangle to the view rectangle.
[in] | targetPoint | Point to map. |
Does | not throw any exception. |
Maps a point from the view rectangle to the image rectangle.
[in] | viewPoint | Point to map. |
Does | not throw any exception. |
Maps a point from the view rectangle to the target rect.
[in] | viewPoint | Point to map. |
Does | not throw any exception. |
|
inlineslot |
Refresh the currently shared image.
Does | not throw any exception. |
This slot may be called from QML.
|
inlinestatic |
Convenience method to register this type in QML.
Does | not throw any exception. |
This type is registered as ImageView in CvbQuick. In addition also the required enums are registered.
|
inlinestatic |
Convenience method to register this type or a derived type in QML.
[in] | uri | URI forwarded to Qt. |
[in] | versionMajor | Major version forwarded to Qt. |
[in] | versionMinor | Minor version forwarded to Qt. |
[in] | qmlName | Name in QML forwarded to Qt. |
Does | not throw any exception. |
Basically just calls qmlRegisterType. In addition also the required enums are registered.
|
inline |
Set the image controller for this view item.
[in] | image | The image controller. |
Does | not throw any exception. |
Use in QML as property: image.
Usually you set an image controller object as context property and assign it to the view's image property.
|
inline |
Set the reference point for mouse operations in image coordinates.
[in] | imageAnchor | The reference point. |
Does | not throw any exception. |
Use in QML as property: imageAnchor.
|
inline |
Set the current upload mode (as integer).
[in] | uploadMode | The new upload mode (as integer, see CVb::UI::UploadMode). |
Any | exception derived from std::exception including CvbException. |
Use in QML as property: uploadMode.
The related enum is automatically registered in QML using ImageViewItem::Register.
|
inline |
Set the reference point for mouse operations in view coordinates.
[in] | viewAnchor | The reference point. |
Does | not throw any exception. |
Use in QML as property: viewAnchor.
|
inline |
Set the view's zoom factor.
[in] | factor | The zoom factor |
Does | not throw any exception. |
Use in QML as property: zoomFactor.
|
inline |
Set the zoom identifier for special zoom steps (as integer, see Cvb::UI::ZoomID).
[in] | id | The zoom ID. |
Does | not throw any exception. |
Use in QML as property: zoomID.
The related enum is automatically registered in QML using ImageViewItem::Register.
|
inlinenoexcept |
Get the rectangle inside the image rectangle that is actually rendered.
Does | not throw any exception. |
Use in QML as property: sourceRect.
|
inlinenoexcept |
Get the rectangle inside the view rectangle the image is actually rendered to.
Does | not throw any exception. |
Use in QML as property: targetRect.
|
inline |
Tries to translate the target rectangle to a give point.
[in] | translation | Point interpreted as vector to translate. |
Does | not throw any exception. |
|
inline |
Tries to zoom in.
Does | not throw any exception. |
|
inline |
Tries to zoom out.
Does | not throw any exception. |
|
inlinenoexcept |
Get the current upload mode (as integer, see Cvb::UI::UploadMode).
Does | not throw any exception. |
Use in QML as property: uploadMode.
The related enum is automatically registered in QML using ImageViewItem::Register.
|
inlinenoexcept |
Get the reference point for mouse operations in view coordinates.
Does | not throw any exception. |
Use in QML as property: viewAnchor.
|
inlinenoexcept |
Get the rectangle this items covers.
Does | not throw any exception. |
Use in QML as property: viewRect.
|
inline |
Get the view's zoom factor.
Does | not throw any exception. |
Use in QML as property: zoomFactor.
|
inline |
Get the zoom identifier for special zoom steps (as integer, see Cvb::UI::ZoomID).
Does | not throw any exception. |
Use in QML as property: zoomID.
The related enum is automatically registered in QML using ImageViewItem::Register.