File util.h
Go to the source code of this file
#include <b2nd.h>#include <xiApi.h>#include <QColor>#include <QMap>#include <QString>#include <boost/log/trivial.hpp>#include <msgpack.hpp>#include <opencv2/highgui/highgui.hpp>#include <string>
Classes
| Type | Name |
|---|---|
| struct | CommandLineArguments Structure used to store command line arguments parsed by the user. |
| class | FileImage Image container responsible of writing images to a file, including metadata. |
Public Attributes
| Type | Name |
|---|---|
| CommandLineArguments | g_commandLineArguments Contains the CLI arguments that can be parsed through the terminal by the user. This is initialized at start of the program, before the Qt application is initialized. |
Public Functions
| Type | Name |
|---|---|
| void | AppendBLOSCVLMetadata (b2nd_array_t * src, const char * key, msgpack::sbuffer & newData) Appends variable length metadata to a BLOSC n-dimensional array. |
| std::string | ColorFilterToString (XI_COLOR_FILTER_ARRAY colorFilterArray) Converts the XIMEA color filter array identifier to a string representation. |
| cv::Mat | CreateLut (const QColor & saturationColor, const QColor & darkColor, int minValue, int maxValue) Created a look up table (LUT) that can be used to define the colors of pixels in an image that are over-saturated or under-exposed. |
| int | GetBLOSCVLMetadataLength (const b2nd_array_t * src, const char * key) Unpacks the metadata in array and computes the number of elements corresponding to the specified key. |
| QString | GetTimeStamp () Generates a timestamp with the format yyyyMMdd_hh-mm-ss-zzz . |
| void | PackAndAppendMetadata (b2nd_array_t * src, const char * key, const std::vector< T > & metadata) Packs and appends the metadata associated with a BLOSC NDarray. |
| void | WaitMilliseconds (int milliseconds) waits a certain amount of milliseconds on a boost thread. |
| void | XIIMGtoMat (const XI_IMG & xi_img, cv::Mat & mat_img) Helper function which wraps a ximea image in a cv::Mat. |
Macros
| Type | Name |
|---|---|
| define | HandleBLOSCResult (res, place) /* multi line expression */Handles the result after BLOSC2 operations when return code is != 0. |
| define | HandleResult (res, place) /* multi line expression */Handles the result from the XiAPI, shows an error message and throws a runtime error if not XI_OK. |
Public Attributes Documentation
variable g_commandLineArguments
Contains the CLI arguments that can be parsed through the terminal by the user. This is initialized at start of the program, before the Qt application is initialized.
Public Functions Documentation
function AppendBLOSCVLMetadata
Appends variable length metadata to a BLOSC n-dimensional array.
Parameters:
srcBLOSC n-dimensional array where the metadata will be addedkeystring to be used as a key for naming the medata data variablenewDatadata package withMessage Pack < https://msgpack.org/ >_.
function ColorFilterToString
Converts the XIMEA color filter array identifier to a string representation.
Parameters:
colorFilterArrayXIMEA color filter array representation
Returns:
string representing the color filter array
function CreateLut
Created a look up table (LUT) that can be used to define the colors of pixels in an image that are over-saturated or under-exposed.
cv::Mat CreateLut (
const QColor & saturationColor,
const QColor & darkColor,
int minValue,
int maxValue
)
Parameters:
saturationColorcolor of pixels that are over-saturated.darkColorcolor of pixels that are under-exposed.minValuesaturation minimum value.maxValuesaturation maximum value.
Returns:
matrix with LUT.
function GetBLOSCVLMetadataLength
Unpacks the metadata in array and computes the number of elements corresponding to the specified key.
Parameters:
srcBLOSC ND-Array from which the metadata should be analyzed.keyIdentifier of the metadata layer from which the number of elements is desired.
Returns:
number of elements in metadata layer or negative value if an error occurred.
function GetTimeStamp
Generates a timestamp with the format yyyyMMdd_hh-mm-ss-zzz .
function PackAndAppendMetadata
Packs and appends the metadata associated with a BLOSC NDarray.
template<typename T>
void PackAndAppendMetadata (
b2nd_array_t * src,
const char * key,
const std::vector< T > & metadata
)
Template parameters:
Tdata type of the metadata
Parameters:
srcpointer to BLOSC array where the metadata will be appendedkeystring that will be used to identify the metadata inside the arraymetadatacontent to be stored in the metadata
function WaitMilliseconds
waits a certain amount of milliseconds on a boost thread.
Parameters:
millisecondsamount of time to WaitMilliseconds
function XIIMGtoMat
Helper function which wraps a ximea image in a cv::Mat.
Parameters:
xi_imginput ximea imagemat_imgoutput cv::Mat image
Macro Definition Documentation
define HandleBLOSCResult
Handles the result after BLOSC2 operations when return code is != 0.
Exception:
runtime
define HandleResult
Handles the result from the XiAPI, shows an error message and throws a runtime error if not XI_OK.
Exception:
runtime
The documentation for this class was generated from the following file src/util.h