GUI Toolkit#

Note

This library is partially under development and may see occasional API changes.

class DisplayScreen : public QWidget#

DisplayScreen handles multiple FrameViewers. That is, a screen may display multiple streaming channels.

Public Functions

void SetDisplayFrame(int viewer_id, cv::Mat *frame, float fps)#

Sets the frame context to be displayed for a viewer given the viewer index.

This function sets the frame context to be displayed on a specific viewer identified by the viewer_id. It also displays the frames per second (FPS) on the screen.

Parameters:
  • viewer_id – The index of the viewer.

  • frame – The frame context represented by a cv::Mat* object.

  • fps – The FPS number to be shown on the screen.

void SetDisplayFrame(int viewer_id, cv::Mat *frame)#

Sets the frame context to be displayed for a viewer given the viewer index, without displaying the FPS number.

This function sets the frame context to be displayed on a specific viewer identified by the viewer_id. The FPS is not displayed on the screen.

Parameters:
  • viewer_id – The index of the viewer.

  • frame – The frame context represented by a cv::Mat* object.

void SetDisplayFrame(int viewer_id, cv::Mat frame)#

Sets the frame context to be displayed for a viewer given the viewer index, without displaying the FPS number.

This function sets the frame context to be displayed on a specific viewer identified by the viewer_id. The FPS is not displayed on the screen.

Parameters:
  • viewer_id – The index of the viewer.

  • frame – The frame context represented by a cv::Mat object.

cv::Mat *GetDisplayFrameBuf(int viewer_id)#

Retrieves the frame context buffer to be displayed for a viewer.

Parameters:

viewer_id – The index of the viewer.

Returns:

A pointer to the cv::Mat object representing the frame context buffer.

uint32_t width()#

Retrieves the width of the display.

This function returns the width of the display screen in pixels.

Returns:

The width of the display screen in pixels.

uint32_t height()#

Retrieves the height of the display.

This function returns the height of the display screen in pixels.

Returns:

The height of the display screen in pixels.

uint32_t GetViewerWidth(int viewer_id)#

Retrieves the width of a specific viewer’s display.

This function returns the width of the display for the viewer identified by viewer_id.

Parameters:

viewer_id – The index of the viewer.

Returns:

The width of the viewer’s display in pixels.

uint32_t GetViewerHeight(int viewer_id)#

Retrieves the height of a specific viewer’s display.

This function returns the height of the display for the viewer identified by viewer_id.

Parameters:

viewer_id – The index of the viewer.

Returns:

The height of the viewer’s display in pixels.

void SetSquareLayout(int num_channels, bool fullscreen = true)#

Sets a square layout for the viewers.

This function arranges the viewers in a square layout based on the number of channels specified.

Parameters:

num_channels – The number of channels to be displayed in the square layout.

uint32_t NumViewers()#

Retrieves the number of viewers.

This function returns the total number of viewers currently managed by this screen.

Returns:

The number of viewers.

void AddViewer(QWidget *viewer)#

Adds a new viewer to the display.

This function adds a new viewer to the application, allowing it to display content.

Advanced usage for user who likes to manually specify the viewer geometry.

Parameters:

viewer – A pointer to the QWidget representing the viewer to be added.

class FrameViewer : public QWidget#

FrameViewer is responsible for displaying images coming from capture devices. For each channel inside a screen, it should be related to a FrameViewer.

class MxQt#

Public Functions

MxQt(int &argc, char *argv[])#

Initialization of screens’ information.

Parameters:
  • argc – argument count passed to main() in C/C++

  • argv – argument vector passed to main() in C/C++

int Run()#

Display the gui and block the current thread until exit.

Public Members

int num_screens#

Number of total available screens.

vector<DisplayScreen*> screens#

Control handle of each screen object.

See also