CVBpy 14.0
ImageViewItem Class Reference

Image view item for QML. More...

Inherits QQuickPaintedItem.

Public Member Functions

None register (cls, str uri="CvbQuick", int version_major=1, int version_minor=0, str qml_name="ImageView")
 Convenience method to register this type or a derived type in QML. More...
 
bool try_translate (self, PySide2.QtCore.QPointF translation)
 Tries to translate the target rectangle to a give point. More...
 
bool try_zoom_in (self)
 Tries to zoom in. More...
 
bool try_zoom_out (self)
 Tries to zoom out. More...
 

Properties

 hoverPixel = property
 The image pixel value the mouse is currently hovered over. More...
 
 hoverPosition = property
 Get the point the mouse is hovering over. More...
 
 image = property
 Get or set the image controller for this view item. More...
 
 imageAnchor = property
 Get the reference point for mouse operations in image coordinates. More...
 
 imageRect = property
 Get the rectangle described by the image buffer associated with the view. More...
 
 sourceRect = property
 Get the rectangle inside the image rectangle that is actually rendered. More...
 
 targetRect = property
 Get the rectangle inside the view rectangle the image is actually rendered to. More...
 
 uploadMode = property
 Get or set the current upload mode (as integer). More...
 
 viewAnchor = property
 Get the reference point for mouse operations in view coordinates. More...
 
 viewRect = property
 Get the rectangle this items covers. More...
 
 zoomFactor = property
 Get or set the view's zoom factor. More...
 

Detailed Description

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

See examples for available properties.

Member Function Documentation

◆ register()

None register (   cls,
str   uri = "CvbQuick",
int   version_major = 1,
int   version_minor = 0,
str   qml_name = "ImageView" 
)

Convenience method to register this type or a derived type in QML.

Basically just calls qmlRegisterType(...).

Parameters

uri : str URI forwarded to Qt.

version_major : int Major version forwarded to Qt.

version_minor : int Minor version forwarded to Qt.

qml_name : str Name in QML forwarded to Qt.

◆ try_translate()

bool try_translate (   self,
PySide2.QtCore.QPointF  translation 
)

Tries to translate the target rectangle to a give point.

This method can be called from QML!

Parameters

translation : QPointF Point interpreted as vector to translate.

Returns

bool True if successful, false otherwise.

◆ try_zoom_in()

bool try_zoom_in (   self)

Tries to zoom in.

This method can be called from QML!

Returns

bool True if successful, false otherwise.

◆ try_zoom_out()

bool try_zoom_out (   self)

Tries to zoom out.

This method can be called from QML!

Returns

bool True if successful, false otherwise.

Property Documentation

◆ hoverPixel

hoverPixel = property
static

The image pixel value the mouse is currently hovered over.

If the value is undefined an empty list is returned.

This is a QML property!

◆ hoverPosition

hoverPosition = property
static

Get the point the mouse is hovering over.

This is a QML property!

◆ image

image = property
static

Get or set the image controller for this view item.

Usually you set an image controller object as context property and assign it to the view's image property.

This is a QML property!

◆ imageAnchor

imageAnchor = property
static

Get the reference point for mouse operations in image coordinates.

This is a QML property!

◆ imageRect

imageRect = property
static

Get the rectangle described by the image buffer associated with the view.

This is a QML property!

◆ sourceRect

sourceRect = property
static

Get the rectangle inside the image rectangle that is actually rendered.

This is a QML property!

◆ targetRect

targetRect = property
static

Get the rectangle inside the view rectangle the image is actually rendered to.

This is a QML property!

◆ uploadMode

uploadMode = property
static

Get or set the current upload mode (as integer).

This is a QML property!

◆ viewAnchor

viewAnchor = property
static

Get the reference point for mouse operations in view coordinates.

This is a QML property!

◆ viewRect

viewRect = property
static

Get the rectangle this items covers.

This is a QML property!

◆ zoomFactor

zoomFactor = property
static

Get or set the view's zoom factor.

This is a QML property!