Skip to content

File constants.h

FileList > src > constants.h

Go to the source code of this file

  • #include <QColor>
  • #include <QJsonArray>
  • #include <QJsonObject>
  • #include <QMap>
  • #include <QString>
  • #include <opencv2/opencv.hpp>

Classes

Type Name
struct CameraData
Structure to hold metadata from camera such as type, family, etc.

Public Attributes

Type Name
const QString CAMERA_FAMILY_XIB = "xiB"
Name of xiB camera family.
const QString CAMERA_FAMILY_XIB64 = "xiB-64"
Name of xiB-64 camera family.
const QString CAMERA_FAMILY_XIC = "xiC"
Name of xiC camera family.
const QString CAMERA_FAMILY_XIQ = "xiQ"
Name of xiQ camera family.
const QString CAMERA_FAMILY_XIRAY = "xiRAY"
Name of xiRay camera family.
const QString CAMERA_FAMILY_XISPEC = "xiSpec"
Name of xiSpec camera family.
const QString CAMERA_FAMILY_XIX = "xiX"
Name of xiX camera family.
const QString CAMERA_TYPE_GRAY = "gray"
Name of gray camera type.
const QString CAMERA_TYPE_RGB = "rgb"
Name of RGB camera type.
const QString CAMERA_TYPE_SPECTRAL = "spectral"
Name of spectral camera type.
const QString CHIP_TEMP = "temperature\_chip"
Variable used to identify camera chip temperature.
constexpr auto COLOR_FILTER_ARRAY_FORMAT_KEY = "color\_filter\_array"
Name of key to be used to store filter array format in the metadata of the arrays.
constexpr auto COLOR_UI_PRIMARY = "#ffd740"
default color of UI enabled elements
constexpr auto DEFAULT_DARK_COLOR = QColor(255, 0, 0)
Color used to represent dark pixels.
constexpr auto DEFAULT_SATURATION_COLOR = QColor(255, 105, 180)
Color used to represent saturation pixels.
const std::vector< QString > EXPECTED_METADATA_KEYS = /* multi line expression */
List of metadata keys expected to be present in an image file.
constexpr auto EXPOSURE_KEY = "exposure\_us"
Name of key to be used to store exposure time in the metadata of the arrays.
const QString FIELD_EDITED_STYLE = "QLineEdit {background-color: rgba(117, 52, 134, 1);}"
Style of input component when edited.
const QString FIELD_ORIGINAL_STYLE = "QLineEdit {background-color: rgba(35, 38, 41, 0.75);}"
Original style of input component.
constexpr int FRAMERATE_MAX = 80
Maximum framerate at which images are polled from camera.
constexpr auto FRAME_NUMBER_KEY = "acq\_nframe"
Name of key to be used to store frame number in the metadata of the arrays.
const QString HOUSE_BACK_TEMP = "temperature\_house\_back\_side"
Variable used to identify camera housing (back) temperature.
const QString HOUSE_TEMP = "temperature\_house"
Variable used to identify camera housing temperature.
const QString LOG_FILE_NAME = "logFile.txt"
File name where logs are stored.
constexpr int MAX_FRAMES_TO_COMPUTE_FPS = 10
Maximum number of frames used to compute the frames per second at which recordings happen.
constexpr int MAX_HEIGHT_DISPLAY_WINDOW = 544
Maximum height of image to display.
constexpr int MAX_WIDTH_DISPLAY_WINDOW = 1024
Maximum width of image to display.
constexpr int NR_REFERENCE_IMAGES_TO_RECORD = 100
Number of images to record for reference images for white anddark .
constexpr int OVEREXPOSURE_PIXEL_BOUNDARY_VALUE = 225
maximum value in range [0, 255] above which pixels are considered over-saturated.
const QString SENSOR_BOARD_TEMP = "temperature\_sensor\_board"
Variable used to identify camera board temperature.
const std::vector SUPPORTED_CAMERA_FAMILIES = /* multi line expression */
Vector of supported camera families.
const std::vector SUPPORTED_CAMERA_TYPES = {CAMERA\_TYPE\_SPECTRAL, CAMERA\_TYPE\_GRAY, CAMERA\_TYPE\_RGB}
Vector of supported camera types.
constexpr int TEMP_LOG_INTERVAL = 5
Variable used to identify how ofter temperature is queried from the camera.
constexpr auto TIME_STAMP_KEY = "time\_stamp"
Name of key to be used to store time stamp in the metadata of the arrays.
constexpr int UNDEREXPOSURE_PIXEL_BOUNDARY_VALUE = 10
minimum value in range [0, 255] below which pixels are considered under-saturated.
constexpr int UPDATE_RATE_MS_FPS_TIMER = 2000
Rate in milliseconds at which the frames per second display in the UI is updated.

Public Functions

Type Name
QMap< QString, CameraData > & getCameraMapper ()
Loads the camera mapper on first call and returns it. This mapper is represented as a constant map with camera models as keys and camera types as values.
bool isCameraSupported (const QString & type, const QString & family)
Checks that the camera type and family are supported by the application.
QMap< QString, CameraData > loadCameraMapperFromJson (const QString & fileName)
Loads a camera mapper configuration from a JSON file.

Public Attributes Documentation

variable CAMERA_FAMILY_XIB

Name of xiB camera family.

const QString CAMERA_FAMILY_XIB;


variable CAMERA_FAMILY_XIB64

Name of xiB-64 camera family.

const QString CAMERA_FAMILY_XIB64;


variable CAMERA_FAMILY_XIC

Name of xiC camera family.

const QString CAMERA_FAMILY_XIC;


variable CAMERA_FAMILY_XIQ

Name of xiQ camera family.

const QString CAMERA_FAMILY_XIQ;


variable CAMERA_FAMILY_XIRAY

Name of xiRay camera family.

const QString CAMERA_FAMILY_XIRAY;


variable CAMERA_FAMILY_XISPEC

Name of xiSpec camera family.

const QString CAMERA_FAMILY_XISPEC;


variable CAMERA_FAMILY_XIX

Name of xiX camera family.

const QString CAMERA_FAMILY_XIX;


variable CAMERA_TYPE_GRAY

Name of gray camera type.

const QString CAMERA_TYPE_GRAY;


variable CAMERA_TYPE_RGB

Name of RGB camera type.

const QString CAMERA_TYPE_RGB;


variable CAMERA_TYPE_SPECTRAL

Name of spectral camera type.

const QString CAMERA_TYPE_SPECTRAL;


variable CHIP_TEMP

Variable used to identify camera chip temperature.

const QString CHIP_TEMP;


variable COLOR_FILTER_ARRAY_FORMAT_KEY

Name of key to be used to store filter array format in the metadata of the arrays.

constexpr auto COLOR_FILTER_ARRAY_FORMAT_KEY;


variable COLOR_UI_PRIMARY

default color of UI enabled elements

constexpr auto COLOR_UI_PRIMARY;


variable DEFAULT_DARK_COLOR

Color used to represent dark pixels.

constexpr auto DEFAULT_DARK_COLOR;

This color is represented as a BGR vector with values (0, 0, 255).


variable DEFAULT_SATURATION_COLOR

Color used to represent saturation pixels.

constexpr auto DEFAULT_SATURATION_COLOR;

This color is represented as a BGR vector with values (180, 105, 255).


variable EXPECTED_METADATA_KEYS

List of metadata keys expected to be present in an image file.

const std::vector<QString> EXPECTED_METADATA_KEYS;

This vector contains the predefined keys required for metadata validation during file operations. Each key corresponds to a specific piece of image metadata, such as exposure time, frame number, color filter array format, timestamp, and sensor board temperature.


variable EXPOSURE_KEY

Name of key to be used to store exposure time in the metadata of the arrays.

constexpr auto EXPOSURE_KEY;


variable FIELD_EDITED_STYLE

Style of input component when edited.

const QString FIELD_EDITED_STYLE;


variable FIELD_ORIGINAL_STYLE

Original style of input component.

const QString FIELD_ORIGINAL_STYLE;


variable FRAMERATE_MAX

Maximum framerate at which images are polled from camera.

constexpr int FRAMERATE_MAX;


variable FRAME_NUMBER_KEY

Name of key to be used to store frame number in the metadata of the arrays.

constexpr auto FRAME_NUMBER_KEY;


variable HOUSE_BACK_TEMP

Variable used to identify camera housing (back) temperature.

const QString HOUSE_BACK_TEMP;


variable HOUSE_TEMP

Variable used to identify camera housing temperature.

const QString HOUSE_TEMP;


variable LOG_FILE_NAME

File name where logs are stored.

const QString LOG_FILE_NAME;


variable MAX_FRAMES_TO_COMPUTE_FPS

Maximum number of frames used to compute the frames per second at which recordings happen.

constexpr int MAX_FRAMES_TO_COMPUTE_FPS;


variable MAX_HEIGHT_DISPLAY_WINDOW

Maximum height of image to display.

constexpr int MAX_HEIGHT_DISPLAY_WINDOW;


variable MAX_WIDTH_DISPLAY_WINDOW

Maximum width of image to display.

constexpr int MAX_WIDTH_DISPLAY_WINDOW;


variable NR_REFERENCE_IMAGES_TO_RECORD

Number of images to record for reference images for white anddark .

constexpr int NR_REFERENCE_IMAGES_TO_RECORD;


variable OVEREXPOSURE_PIXEL_BOUNDARY_VALUE

maximum value in range [0, 255] above which pixels are considered over-saturated.

constexpr int OVEREXPOSURE_PIXEL_BOUNDARY_VALUE;

The maximum value is 225 in the range [0,255], which corresponds to 900 in the range [0, 1024].


variable SENSOR_BOARD_TEMP

Variable used to identify camera board temperature.

const QString SENSOR_BOARD_TEMP;


variable SUPPORTED_CAMERA_FAMILIES

Vector of supported camera families.

const std::vector SUPPORTED_CAMERA_FAMILIES;


variable SUPPORTED_CAMERA_TYPES

Vector of supported camera types.

const std::vector SUPPORTED_CAMERA_TYPES;


variable TEMP_LOG_INTERVAL

Variable used to identify how ofter temperature is queried from the camera.

constexpr int TEMP_LOG_INTERVAL;


variable TIME_STAMP_KEY

Name of key to be used to store time stamp in the metadata of the arrays.

constexpr auto TIME_STAMP_KEY;


variable UNDEREXPOSURE_PIXEL_BOUNDARY_VALUE

minimum value in range [0, 255] below which pixels are considered under-saturated.

constexpr int UNDEREXPOSURE_PIXEL_BOUNDARY_VALUE;

The minimum value is 10 in the range [0,255], which corresponds to 40 in the range [0, 1024].


variable UPDATE_RATE_MS_FPS_TIMER

Rate in milliseconds at which the frames per second display in the UI is updated.

constexpr int UPDATE_RATE_MS_FPS_TIMER;


Public Functions Documentation

function getCameraMapper

Loads the camera mapper on first call and returns it. This mapper is represented as a constant map with camera models as keys and camera types as values.

QMap< QString, CameraData > & getCameraMapper () 

Returns:

A mapper that maps camera models to their corresponding type and family, e.g. (spectral, xiSpec), (gray, xiC), etc.


function isCameraSupported

Checks that the camera type and family are supported by the application.

bool isCameraSupported (
    const QString & type,
    const QString & family
) 

Parameters:

  • type The type of camera, e.g. spectral, rgb or gray.
  • family The camera family, e.g. xiQ, xiC or xiU.

Returns:

true if both camera type and family are supported


function loadCameraMapperFromJson

Loads a camera mapper configuration from a JSON file.

QMap< QString, CameraData > loadCameraMapperFromJson (
    const QString & fileName
) 

This function reads a JSON configuration file specified by the fileName and initializes a camera mapper based on the data within the file. The JSON file must adhere to the expected schema for this operation to succeed. The camera mapper configuration typically involves parameters such as camera mosaic shape, camera family, etc.

Parameters:

  • fileName The path to the JSON file containing the camera mapper configuration.

Returns:

Returns true if the camera mapper configuration was successfully loaded, false otherwise.



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