60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#ifndef CAMPREVIEW_H
|
|
#define CAMPREVIEW_H
|
|
|
|
#include <QComboBox>
|
|
#include <QLabel>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QDialogButtonBox>
|
|
#include <QStackedWidget>
|
|
#include <QGridLayout>
|
|
#include <QSpinBox>
|
|
#include <QPainter>
|
|
#include <pylon/PylonIncludes.h>
|
|
|
|
#include "pylonwrapper.h"
|
|
#include "util.h"
|
|
namespace Ui {
|
|
class CameraPreview;
|
|
}
|
|
|
|
class CameraPreview : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CameraPreview(QWidget *parent = 0);
|
|
~CameraPreview();
|
|
|
|
ROI getRoi();
|
|
void updateROI(bool emitSignal=true);
|
|
void setSize(int width, int height);
|
|
QString device();
|
|
|
|
public slots:
|
|
void setCamera(QString &device);
|
|
void updateWidth(QString s);
|
|
void updateHeight(QString s);
|
|
void updateXoffs(QString s);
|
|
void updateYoffs(QString s);
|
|
|
|
signals:
|
|
void roiUpdated(int x, int y, int width, int height);
|
|
|
|
private:
|
|
QString cameraname;
|
|
QSpinBox *width, *height, *xoffs, *yoffs;
|
|
QLabel *imgLabel;
|
|
QLabel *label;
|
|
|
|
QPixmap pm;
|
|
|
|
void takeStill();
|
|
void setImage(const QPixmap &img);
|
|
void validate(QSpinBox *origin, QSpinBox *dest, int limit);
|
|
|
|
PylonWrapper *camera;
|
|
|
|
};
|
|
|
|
#endif // CAMPREVIEW_H
|