49 lines
834 B
C++
49 lines
834 B
C++
#ifndef CAMERA_H
|
|
#define CAMERA_H
|
|
|
|
#include <QObject>
|
|
#include "pylon/PylonIncludes.h"
|
|
#include "QDebug"
|
|
#include "thread"
|
|
#include "chrono"
|
|
#include "QImage"
|
|
#include <pylon/BaslerUniversalInstantCamera.h>
|
|
#include "algorithm"
|
|
|
|
#define FRAME 10;
|
|
#define GRABTIMEOUT 5000;
|
|
|
|
|
|
// Namespace for using pylon objects.
|
|
using namespace Pylon;
|
|
|
|
// Namespace for using GenApi objects.
|
|
using namespace GenApi;
|
|
|
|
// Namespace for using cout.
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Camera : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Camera(QObject *parent = nullptr);
|
|
~Camera();
|
|
void open();
|
|
void close();
|
|
void getSinglePic();
|
|
|
|
|
|
signals:
|
|
void sendPicData(QImage);
|
|
|
|
private:
|
|
CBaslerUniversalInstantCamera *cam;
|
|
std::thread *task;
|
|
bool state;
|
|
};
|
|
|
|
#endif // CAMERA_H
|