-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawDepthView.h
More file actions
executable file
·78 lines (61 loc) · 2.32 KB
/
DrawDepthView.h
File metadata and controls
executable file
·78 lines (61 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* @file DrawDepthView.h
* @ingroup Drawing Kinect
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
* @copyright All right reserved.
*/
#ifndef __DRAW_DEPTH_VIEW_H__
#define __DRAW_DEPTH_VIEW_H__
#include "DrawRawData.h"
#define DepthFileName "/depth/depth.timestamp" /*!< @brief Timestamp file for the depth input from Kinect1 or Kinect2 */
#define RawDepthFileName "/depth/depth.raw" /*!< @brief Raw file for the depth input from Kinect1 or Kinect2 */
#ifdef KINECT_1
namespace MobileRGBD { namespace Kinect1 {
}} // namesapce MobileRGBD::Kinect1
#endif // KINECT_1
#ifdef KINECT_2
namespace MobileRGBD { namespace Kinect2 {
/**
* @class DrawDepthView DrawDepthView.cpp DrawDepthView.h
* @brief Class to draw depth stream from the Kinect2 data.
*
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
*/
class DrawDepthView : public DrawRawData
{
public:
/** @brief constructor. Draw data from the depth stream of the Kinect2.
*
* @param Folder [in] Main folder containing the data. Body data will be search in 'Folder/depth/' subfolder.
* @param SizeOfFrame [in] Size of each frame. Default value = DepthWidth*DepthHeight*DepthBytesPerPixel.
*/
DrawDepthView( const std::string& Folder, int SizeOfFrame = DepthWidth*DepthHeight*DepthBytesPerPixel )
: DrawRawData( Folder + DepthFileName, Folder + RawDepthFileName, SizeOfFrame )
{
ImageBuffer = new unsigned char[DepthWidth*DepthHeight*3]; // BGR data
}
/** @brief Static function to draw data from RGB raw Kinect buffer.
*
*/
static void Draw( cv::Mat& WhereToDraw, void * FrameBuffer, void * DrawingBuffer = nullptr );
/** @brief Virtual destructor, always.
*/
~DrawDepthView()
{
if ( ImageBuffer != nullptr )
{
delete ImageBuffer;
}
};
/** @brief ProcessElement is a callback function called by mother classes when data are ready.
*
* @param RequestTimestamp [in] The timestamp of the data.
* @param UserData [in] User pointer to working data. Here a pointer to a cv:Mat to draw in.
*/
virtual bool ProcessElement( const TimeB &RequestTimestamp, void * UserData = nullptr );
protected:
unsigned char * ImageBuffer; /*!< @brief Buffer to work on the data. */
};
}} // namespace MobileRGBD::Kinect2
#endif // KINECT_2
#endif // __DRAW_DEPTH_VIEW_H__