00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00035 #ifndef __DEPTH_H__
00036 #define __DEPTH_H__
00037
00038 #include "../lib/common.h"
00039 #include "../core/GenericGenerator.h"
00040 #define MAX_DEPTH 10000
00041
00042 namespace NIDevice
00043 {
00044 namespace Generator
00045 {
00046 class Depth : public NIDevice::Core::GenericGenerator<xn::DepthGenerator, XN_NODE_TYPE_DEPTH>
00047 {
00048 public:
00049 Depth(NIDevice::Objects::KinectDevice* pDevice);
00050 ~Depth();
00051
00052 const unsigned short* GetDepthBuffer(bool useMutex);
00053
00054 void GetDepthSize(int &w, int &h);
00055 int SetOutputMode(int, int, int);
00056 float* GetHistory();
00057 bool UpdateData();
00058 void SetDistCutoff(int dist);
00059 int GetDistCutoff();
00060 void SetAngCutoff(float ang);
00061 float GetAngCutoff();
00062
00066 NIDEVICE_GET_OBJECT_TYPE_AS_STRING(DeviceManager);
00067 NIDEVICE_GET_ERROR_MESSAGE(nRetVal,description);
00068
00069 private:
00070 xn::DepthMetaData g_depthMD;
00071 unsigned short* depthData;
00072 float g_pDepthHist[MAX_DEPTH];
00073 int width;
00074 int height;
00075 XnStatus nRetVal;
00076 XnUInt32 iDistCutoff;
00077 float fAngCutoff;
00078 std::string description;
00079 void DepthCutoff();
00080
00081 protected:
00082 Depth();
00083 };
00084 }
00085 }
00086
00087
00088 #endif