| 1 |
|
| 2 |
rt |
| 3 |
on |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef KINECT_H |
| 20 |
#define KINECT_H |
| 21 |
|
| 22 |
#include <QObject> |
| 23 |
#include <QPixmap> |
| 24 |
#include <QLabel> |
| 25 |
#include <QKeyEvent> |
| 26 |
#include <QGLWidget> |
| 27 |
#include <QPainter> |
| 28 |
#include <qmath.h> |
| 29 |
#include "qkinect/QKinect.h" |
| 30 |
|
| 31 |
#define KINECT_PRECISION 1280 |
| 32 |
|
| 33 |
class ExtKinectManager : public QLabel { |
| 34 |
Q_OBJECT |
| 35 |
public: |
| 36 |
explicit ExtKinectManager(QWidget *parent = 0); |
| 37 |
|
| 38 |
public: |
| 39 |
void paint(); |
| 40 |
qreal getDepthAt(qreal x, qreal y) const; |
| 41 |
|
| 42 |
private: |
| 43 |
quint16 frameCounter; |
| 44 |
int timerCounter, timerFrame; |
| 45 |
qreal threshMin, threshMax; |
| 46 |
QKinect *kinect; |
| 47 |
QLabel *labelCam; |
| 48 |
std::vector<uint8_t> bufferCam, bufferDepth; |
| 49 |
std::vector<uint16_t> bufferDepth16; |
| 50 |
qreal bufferFinal[FREENECT_FRAME_PIX], bufferFinalOld[FREENECT_FRAME_PIX]; |
| 51 |
qreal rawToMeters[2048]; |
| 52 |
quint8 colorK[KINECT_PRECISION+1], colorR[KINECT_PRECISION+1], colorG[KINECT_PRECISION+1], colorB[KINECT_PRECISION+1]; |
| 53 |
|
| 54 |
private: |
| 55 |
void timerEvent(QTimerEvent *); |
| 56 |
void keyPressEvent(QKeyEvent *); |
| 57 |
|
| 58 |
signals: |
| 59 |
|
| 60 |
public slots: |
| 61 |
|
| 62 |
}; |
| 63 |
|
| 64 |
#endif |