-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKinectImageConverter.h
executable file
·57 lines (49 loc) · 2.13 KB
/
KinectImageConverter.h
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
/**
* @file KinectImageConverter.h
* @ingroup Kinect
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
* @author Emeric Grange, Inria
* @copyright All right reserved.
*/
#ifndef __KINECT_IMAGE_CONVERTER_H__
#define __KINECT_IMAGE_CONVERTER_H__
#include <System/MemoryBuffer.h>
/**
* @class DrawBodyIndexView DrawBodyIndexView.cpp DrawBodyIndexView.h
* @brief Class to convert YVY2 from Kinect2 to BGR buffer
*
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
* @author Emeric Grange, Inria
*/
class KinectImageConverter
{
public:
/** @brief constructor.
*/
KinectImageConverter() {}
/** @brief Virtual destructor, always.
*/
virtual ~KinectImageConverter() {}
/** @brief Conversion function in internal buffer. A buffer will be allocated an return for conversion.
*
* @param buffer_in [in] buffer to the YVY2 data from the Kinect2.
* @param rawFile_width [in] original width of the data.
* @param rawFile_height [in] original height of the data.
* @param resizefactor [in] resize image to a smaller one (by parsing less data from buffer_in). resizefactor must be a power of 2.
* @return Pointer to an internal buffer used for conversion. nullptr if there was a problem.
*/
unsigned char * ConvertYVY2ToBRG(unsigned char *buffer_in, int rawFile_width, int rawFile_height, int resizefactor = 1 );
/** @brief Conversion function in internal buffer. A buffer will be allocated an return for conversion.
*
* @param buffer_in [in] buffer to the YVY2 data from the Kinect2.
* @param buffer_out [in,out] buffer where the BGR data will be stored.
* @param rawFile_width [in] original width of the data.
* @param rawFile_height [in] original height of the data.
* @param resizefactor [in] resize image to a smaller one (by parsing less data from buffer_in). resizefactor must be a power of 2.
* @return true if conversion was done.
*/
bool ConvertYVY2ToBRG(unsigned char *buffer_in, unsigned char *buffer_out, int rawFile_width, int rawFile_height, int resizefactor = 1 );
protected:
Omiscid::MemoryBuffer InternalBuffer;
};
#endif // __KINECT_IMAGE_CONVERTER_H__