1#ifndef __JBXL_OPENNI2_DEV_H_
2#define __JBXL_OPENNI2_DEV_H_
8#pragma warning(disable:4005)
23#define OPENNI2_DEVICE_PS1080 "PS1080"
24#define OPENNI2_DEVICE_KINECT "Kinect"
25#define OPENNI2_DEVICE_ONIFILE "oni File"
28#define OPENNI2_STREAM_DATA_NUM 3
30#define OPENNI2_DEPTH_FLAG 0x01
31#define OPENNI2_IMAGE_FLAG 0x02
34#define OPENNI2_DEPTH_INDEX 0
35#define OPENNI2_IMAGE_INDEX 1
43 virtual ~COpenNi2Device(
void) { free();}
57 BOOL init(BOOL use_image);
58 BOOL init(
char* fname, BOOL use_image);
62 BOOL create_Context(
char* fname=NULL);
63 BOOL create_Recorder(
char* fname, BOOL use_image);
65 BOOL create_Image(
void);
66 BOOL create_Depth(
void);
67 BOOL create_User(
void);
69 void delete_Context(
void);
70 void delete_Recorder(
void);
72 void delete_Image(
void);
73 void delete_Depth(
void);
74 void delete_User(
void);
77 void wait_StreamData(
void);
79 BOOL set_ImageData(
void);
80 BOOL set_DepthData(
void);
81 BOOL set_SceneData(
void);
83 uByte* get_ImageData(
void) {
if (imageFrame.isValid())
return (
uByte*)imageFrame.getData();
else return NULL;}
84 uByte* get_DepthData(
void) {
if (depthFrame.isValid())
return (
uByte*)depthFrame.getData();
else return NULL;}
85 uByte* get_SceneData(
void) {
if (userFrame.isValid())
return (
uByte*)userFrame.getUserMap().getPixels();
else return NULL;}
88 openni::Device* context;
90 openni::VideoStream* image;
91 openni::VideoStream* depth;
94 openni::VideoFrameRef imageFrame;
95 openni::VideoFrameRef depthFrame;
98 openni::VideoMode imageMode;
99 openni::VideoMode depthMode;
101 openni::Recorder* recorder;
104 nite::UserTracker* user;
105 nite::UserTrackerFrameRef userFrame;
108 unsigned char m_stream_flg;
110 BOOL m_has_image_data;
111 BOOL m_has_depth_data;
114 openni::VideoStream* m_streams[OPENNI2_STREAM_DATA_NUM];
118 BOOL setup_Tracking(
int profile,
double smooth);
121 BOOL start_Recorde(
char* file_name, BOOL use_image);
122 void stop_Recorde(
void);
126 BOOL open_USB_Device (
void) {
return FALSE;}
127 void close_USB_Device(
void) {}
128 void set_LED_Color (
int col) {}
129 void set_Tilt_Motor(
int ang) {}
137Buffer initialize_OpenNI2(
void);
138void shutdown_OpenNI2(
void);
140Buffer initialize_NiTE2(
void);
141void shutdown_NiTE2(
void);