Skip to content

Class DisplayerFunctional

ClassList > DisplayerFunctional

The DisplayerFunctional class is responsible for displaying images.More...

  • #include <displayFunctional.h>

Inherits the following classes: Displayer

Public Attributes

Type Name
QString m_cameraModel
Camera model used to identify camera properties.
QString m_cameraType = CAMERA\_TYPE\_SPECTRAL
Type of camera being used: spectral, gray, etc.
cv::Mat m_lut = /* multi line expression */
Look up table used to assign pixel colors to undersaturated and oversaturated pixels.
std::vector< int > m_mosaicShape
Mosaic shape, particularly used for mosaic type cameras.

Public Attributes inherited from Displayer

See Displayer

Type Name
QString m_cameraType
Stores the type or model of the camera currently used.

Public Slots

Type Name
slot void Display (XI_IMG & image)
Qt slot used to display images whenever a new image is queried from the camera.
slot void OnDisplayTimeout
Qt slot that triggers the process to display image once the timer has run out.

Public Slots inherited from Displayer

See Displayer

Type Name
slot void Display (XI_IMG & image)
Qt slot in charge of displaying images.

Public Signals inherited from Displayer

See Displayer

Type Name
signal void ImageReadyToUpdateRGB (QImage)
Qt signal emitted when an RGB image is ready to be displayed in the UI.
signal void ImageReadyToUpdateRaw (QImage)
Qt signal emitted when a raw image is ready to be displayed in the UI.
signal void SaturationPercentageReady (double undersaturation, double oversaturation)
Qt signal emitted when the saturation values are ready to be displayed in the UI.

Public Functions

Type Name
DisplayerFunctional (MainWindow * mainWindow)
Constructor of functional displayer.
DisplayerFunctional ()
Constructor of functional displayer.
virtual void SetCameraProperties (QString cameraModel) override
Assigns camera properties such as type and mosaic shape.
virtual void UpdateBGRChannels (const std::vector< int > & bgrChannels) override
Updates the BGR channel values for the displayer.
virtual void UpdateLut (int minValue, int maxValue, const QColor & darkColor, const QColor & saturatedColor) override
Updates the lookup table (LUT) with the specified minimum and maximum values.
~DisplayerFunctional () override
Destructor of the DisplayerFunctional class. It destroys the windows created by the displayer.

Public Functions inherited from Displayer

See Displayer

Type Name
Displayer (QObject * parent=nullptr)
virtual void SetCameraProperties (QString cameraModel) = 0
Configures the camera properties based on the provided camera model.
void StartDisplayer ()
Allows to start or continue displaying images.
void StopDisplayer ()
Blocks the display of images.
virtual void UpdateBGRChannels (const std::vector< int > & bgrChannels)
Updates the BGR channel values for the displayer.
virtual void UpdateLut (int minValue, int maxValue, const QColor & darkColor, const QColor & saturatedColor)
Updates the lookup table (LUT) with the specified minimum and maximum values.
~Displayer () override

Public Static Functions

Type Name
void DownsampleImageIfNecessary (cv::Mat & image)
Down-samples image in case it is bigger than maximum dimensions.

Protected Attributes

Type Name
MainWindow * m_mainWindow = {}
reference to the main window, necessary to read UI element values.

Protected Attributes inherited from Displayer

See Displayer

Type Name
QColor m_darkColor
The color used to highlight underexposed regions of the image.
boost::condition_variable m_displayCondition
Condition variable used to wait until a new image is available to be processed.
QColor m_saturatedColor
bool m_stop = false
Indicate that process should stop displaying images.

Detailed Description

It inherits from the Displayer class and uses the MainWindow class for reference. It displays the raw, RGB and functional estimated images based on the images collected from the camera.

Public Attributes Documentation

variable m_cameraModel

Camera model used to identify camera properties.

QString DisplayerFunctional::m_cameraModel;


variable m_cameraType

Type of camera being used: spectral, gray, etc.

QString DisplayerFunctional::m_cameraType;


variable m_lut

Look up table used to assign pixel colors to undersaturated and oversaturated pixels.

cv::Mat DisplayerFunctional::m_lut;


variable m_mosaicShape

Mosaic shape, particularly used for mosaic type cameras.

std::vector<int> DisplayerFunctional::m_mosaicShape;


Public Slots Documentation

slot Display

Qt slot used to display images whenever a new image is queried from the camera.

void DisplayerFunctional::Display;

When a new image arrives, it is stored in the a member variable and it sets a flag to indicate that a new image is ready for processing.

Parameters:

  • image image to be displayed

slot OnDisplayTimeout

Qt slot that triggers the process to display image once the timer has run out.

void DisplayerFunctional::OnDisplayTimeout;


Public Functions Documentation

function DisplayerFunctional [1/2]

Constructor of functional displayer.

explicit DisplayerFunctional::DisplayerFunctional (
    MainWindow * mainWindow
) 

Parameters:

  • mainWindow reference to main window application

function DisplayerFunctional [2/2]

Constructor of functional displayer.

inline explicit DisplayerFunctional::DisplayerFunctional () 


function SetCameraProperties

Assigns camera properties such as type and mosaic shape.

virtual void DisplayerFunctional::SetCameraProperties (
    QString cameraModel
) override

Parameters:

  • cameraModel camera type to set

Implements Displayer::SetCameraProperties


function UpdateBGRChannels

Updates the BGR channel values for the displayer.

virtual void DisplayerFunctional::UpdateBGRChannels (
    const std::vector< int > & bgrChannels
) override

This method is used to set the values of the Blue, Green, and Red channels for processing or rendering purposes. The values provided in the input parameter define the specific intensities or configurations for each channel.

Parameters:

  • bgrChannels A vector containing the values for the Blue, Green, and Red channels, typically in the order [Blue, Green, Red].

Implements Displayer::UpdateBGRChannels


function UpdateLut

Updates the lookup table (LUT) with the specified minimum and maximum values.

virtual void DisplayerFunctional::UpdateLut (
    int minValue,
    int maxValue,
    const QColor & darkColor,
    const QColor & saturatedColor
) override

This method adjusts the LUT range to enhance or modify the image display settings based on the given values. It allows flexibility in defining the lower and upper bounds of the LUT.

Parameters:

  • minValue The minimum value for the LUT.
  • maxValue The maximum value for the LUT.
  • darkColor The color used to highlight underexposed regions of the image.
  • saturatedColor The color used to highlight overexposed regions of the image.

Implements Displayer::UpdateLut


function ~DisplayerFunctional

Destructor of the DisplayerFunctional class. It destroys the windows created by the displayer.

DisplayerFunctional::~DisplayerFunctional () override


Public Static Functions Documentation

function DownsampleImageIfNecessary

Down-samples image in case it is bigger than maximum dimensions.

static void DisplayerFunctional::DownsampleImageIfNecessary (
    cv::Mat & image
) 

The maximum dimensions are defined by: constants::MAX_WIDTH_DISPLAY_WINDOW and constants::MAX_HEIGHT_DISPLAY_WINDOW

Parameters:

  • image image to be downsampled

Protected Attributes Documentation

variable m_mainWindow

reference to the main window, necessary to read UI element values.

MainWindow* DisplayerFunctional::m_mainWindow;



The documentation for this class was generated from the following file src/displayFunctional.h