71 lines
1.0 KiB
C++
71 lines
1.0 KiB
C++
#ifndef __APP__
|
|
#define __APP__
|
|
|
|
#include <Windows.h>
|
|
#include <Kinect.h>
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
#include <vector>
|
|
|
|
#include <wrl/client.h>
|
|
using namespace Microsoft::WRL;
|
|
|
|
class Kinect
|
|
{
|
|
private:
|
|
// Sensor
|
|
ComPtr<IKinectSensor> kinect;
|
|
|
|
// Reader
|
|
ComPtr<IColorFrameReader> colorFrameReader;
|
|
|
|
// Color Buffer
|
|
std::vector<BYTE> colorBuffer;
|
|
int colorWidth;
|
|
int colorHeight;
|
|
unsigned int colorBytesPerPixel;
|
|
cv::Mat colorMat;
|
|
|
|
public:
|
|
// Constructor
|
|
Kinect();
|
|
|
|
// Destructor
|
|
~Kinect();
|
|
|
|
// Processing
|
|
void run();
|
|
|
|
private:
|
|
// Initialize
|
|
void initialize();
|
|
|
|
// Initialize Sensor
|
|
inline void initializeSensor();
|
|
|
|
// Initialize Color
|
|
inline void initializeColor();
|
|
|
|
// Finalize
|
|
void finalize();
|
|
|
|
// Update Data
|
|
void update();
|
|
|
|
// Update Color
|
|
inline void updateColor();
|
|
|
|
// Draw Data
|
|
void draw();
|
|
|
|
// Draw Color
|
|
inline void drawColor();
|
|
|
|
// Show Data
|
|
void show();
|
|
|
|
// Show Color
|
|
inline void showColor();
|
|
};
|
|
|
|
#endif // __APP__
|