Library tcfusionzoom  1.0.3
This library can be used for accessing TCFusionZoom devices
Library for accessing TCFusionZoom - A Brief Description.

Introduction

This library can be used to access the TCFusionZoom hardware via USB. Each TFC frame contains a TMC (thermal image) and jpeg (day light image). To uncompress the TMC please use the libtmc.so. The resolution of the jpeg is 1920x1080.

Some short example code shows the general use. Include "tcfusionzoom.h", define a callback function for TFCs and put that callback function pointer in the constructor of TCFusionZoom.

On every received TFC the callbackTFC(...) is called with the present TFC.

The code below can be compiled this way (with adapted include and library paths):

Code example:

#include "tcfusionzoom.h"
#include <iostream>
#include <chrono>
#include <thread>
class Test
{
public:
void test();
void callbackTFC2(TFC& tfc);
};
void callbackTFC1(TFC& tfc, void* caller)
{
std::cout << "callbackTFC1 with tmc size " << tfc.irDataSize << " and jpeg size " << tfc.jpegDataSize << std::endl;
// Use this to reference the caller's callback function (object "Test").
((Test*)caller)->callbackTFC2(tfc);
}
void Test::test()
{
std::cout << "Test: test()" << std::endl;
TCFZ = new TCFusionZoom(callbackTFC1, this); // Register callback
TCFZ->sendCmdUSBTransferOutOn(); // Start usb streaming
// run demo for 20 seconds
std::this_thread::sleep_for(std::chrono::milliseconds(20000));
TCFZ->sendCmdUSBTransferOutOff(); // Start usb streaming
delete TCFZ;
}
void Test::callbackTFC2(TFC& tfc)
{
std::cout << "Test: callbackTFC2 with tmc size " << tfc.irDataSize << " and jpeg size " << tfc.jpegDataSize << std::endl;
}
int main()
{
std::cout << "main:" << std::endl;
{
Test* t = new Test();
t->test();
delete t;
}
return 0;
}