CVB++ 14.0
ImageController Class Reference

Controller object for the QML image view item. More...

#include <cvb/ui/image_view_item.hpp>

Inherits QObject.

Public Member Functions

ImagePtr Image () const
 Get the currently shared image. More...
 
void ReleaseRefreshShare () noexcept
 Releases the shared image. More...
 
void Refresh (const ImagePtr &image, AutoRefresh autoRefresh=AutoRefresh::Off)
 Share the image and refresh the view. More...
 
void Refresh ()
 Refresh the view. More...
 
int Width () const noexcept
 Width of the shared image in pixels. More...
 
int Height () const noexcept
 Height of the shared image in pixels. More...
 
int PlanesCount () const noexcept
 Get the number of planes for this image. More...
 

Detailed Description

Controller object for the QML image view item.

An instance of this class should be set as context property for QML context. In QML an instance of ImageViewItem can connect to this instance by binding it to its image property.

Examples
Cvb/QmlImageDisplay, Cvb/QmlStreamDisplay, Foundation/QmlBlobSearch, GevServer/QmlGevServer, Minos/QmlMinos, and Polimago/QmlCookieClassification.

Member Function Documentation

◆ Height()

int Height ( ) const
inlinenoexcept

Height of the shared image in pixels.

Returns
Height in pixels.
Exceptions
Doesnot throw any exception.

If no image is shared, return 0.

Use in QML as property: height.

◆ Image()

ImagePtr Image ( ) const
inline

Get the currently shared image.

Returns
ImagePtr The currently shared image.
Exceptions
Doesnot throw any exception.

◆ PlanesCount()

int PlanesCount ( ) const
inlinenoexcept

Get the number of planes for this image.

Returns
Number of planes.
Exceptions
Doesnot throw any exception.

If no image is shared, return 0.

Use in QML as property: planesCount.

◆ Refresh() [1/2]

void Refresh ( )
inline

Refresh the view.

Exceptions
Doesnot throw any exception.

◆ Refresh() [2/2]

void Refresh ( const ImagePtr image,
AutoRefresh  autoRefresh = AutoRefresh::Off 
)
inline

Share the image and refresh the view.

Parameters
[in]imageThe image, which will be shared with the display.
[in]autoRefreshSwitch to control automatic refreshing.
Exceptions
Doesnot throw any exception.
Examples
Cvb/QmlImageDisplay, Cvb/QmlStreamDisplay, and Foundation/QmlBlobSearch.

◆ ReleaseRefreshShare()

void ReleaseRefreshShare ( )
inlinenoexcept

Releases the shared image.

Exceptions
Doesnot throw any exception.

Use this method if you must release the shared image manually. Setting a new shared image and destroying this image view will automatically release the shared image.

◆ Width()

int Width ( ) const
inlinenoexcept

Width of the shared image in pixels.

Returns
Width in pixels.
Exceptions
Doesnot throw any exception.

If no image is shared, return 0.

Use in QML as property: width.