I am using the ThermoVision SDK in Qt to communicate with a FLIR A320 IR Camera. The ThermoVision SDK is ActiveX based. I am having trouble retrieving an image from the camera with the GetImage method, which according to the manual can be used in the following way:
Image = Object.GetImage(imageType)
Image is of type VARIANT and contains either a 2-dimensional array with image pixels or an error code (short). imageType determines the type of the pixels (16-bit unsigned integers, single-precision floats or 8-bit unsigned integers).
I am working in Qt so I created a wrapper for the ActiveX component by means of dumpcpp.exe. Unfortunately the GetImage method now returns a QVariant rather than a VARIANT:
inline QVariant LVCam::GetImage(int imageType)
{
QVariant qax_result;
void *_a[] = {(void*)&qax_result, (void*)&imageType};
qt_metacall(QMetaObject::InvokeMetaMethod, 46, _a);
return qax_result;
}
I call the GetImage method as follows:
QVariant vaIm = m_ircam->GetImage(20 + 3);
How can I access the pixels in the QVariant, e.g. by converting it to a two-dimensional array of floats? I tried using methods like QVariant::toFloat(), QVariant::toByteArray(), QVariant::toList(), but none of them seemed to return the image data.
Any help will be appreciated.