1#ifndef __JBXL_OPENNI_DEV_H_
2#define __JBXL_OPENNI_DEV_H_
13#pragma warning(disable:4996)
16#include <XnCppWrapper.h>
32 virtual ~COpenNiDevice(
void) { free();}
47 BOOL init(BOOL use_image);
48 BOOL init(
char* fname, BOOL use_image);
52 BOOL create_Context(
char* fname=NULL);
53 BOOL create_Image (BOOL easy=
FALSE);
54 BOOL create_Depth (BOOL easy=
FALSE);
55 BOOL create_User (BOOL easy=
FALSE);
56 BOOL create_Player(BOOL easy=
FALSE);
58 void delete_Context(
void);
59 void delete_Image(
void);
60 void delete_Depth(
void);
61 void delete_User(
void);
62 void delete_Player(
void);
65 XnMapOutputMode outputMode;
68 xn::ImageGenerator* image;
69 xn::DepthGenerator* depth;
70 xn::UserGenerator* user;
73 xn::ImageMetaData* imageMD;
74 xn::DepthMetaData* depthMD;
75 xn::SceneMetaData* sceneMD;
77 xn::Recorder* recorder;
78 xn::SkeletonCapability* skeleton;
86 BOOL setup_Tracking(
int profile,
double smooth);
87 void clear_Skeleton(
void);
88 void clear_Tracking(
void);
91 BOOL create_Recorder(
char* file_name, BOOL use_image);
92 void delete_Recorder(
void);
94 BOOL start_Recorde(
char* file_name, BOOL use_image);
95 void stop_Recorde(
void);
99 XN_USB_DEV_HANDLE usb_dev;
100 XnUSBConnectionString* devPath;
104 BOOL open_USB_Device (
void);
105 void close_USB_Device(
void);
106 void set_LED_Color (
int col);
107 void set_Tilt_Motor(
int ang);
110 XnCallbackHandle userCallbacks;
111 XnCallbackHandle poseCallbacks;
112 XnCallbackHandle calibCallbacks;
116 BOOL setup_CallBacks(
void);
117 void clear_CallBacks(
void);
119 BOOL set_UserCallbacks(xn::UserGenerator::UserHandler newUser, xn::UserGenerator::UserHandler lostUser,
void* cookie);
120 BOOL set_CalibCallbacks(xn::SkeletonCapability::CalibrationStart calibStart, xn::SkeletonCapability::CalibrationEnd calibEnd,
void* cookie);
122 void unset_UserCallbacks(
void);
123 void unset_CalibCallbacks(
void);
131void XN_CALLBACK_TYPE userDetect(xn::UserGenerator& user, XnUserID nId,
void* cookie);
132void XN_CALLBACK_TYPE userLost (xn::UserGenerator& user, XnUserID nId,
void* cookie);
133void XN_CALLBACK_TYPE calibStart(xn::SkeletonCapability& skeleton, XnUserID nId,
void* cookie);
134void XN_CALLBACK_TYPE calibEnd (xn::SkeletonCapability& skeleton, XnUserID nId, XnBool success,
void* cookie);