-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHifdTypes.h
More file actions
119 lines (106 loc) · 4.28 KB
/
HifdTypes.h
File metadata and controls
119 lines (106 loc) · 4.28 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#pragma once
/*******************************************************************************************
*
* Copyright 2018, HiScene
*
* This file is HiScene's property. It contains HiScene's proprietary and confidential
* information and trade secret. The information and code contained in this file is only
* intended for authorized HiScene employees and customers.
*
* DO NOT DISTRIBUTE, DUPLICATE OR TRANSMIT IN ANY FORM WITHOUT PROPER AUTHORIZATION FROM
* HISCENE.
*
* If you are not an intended recipient of this file, you must not copy, distribute, modify,
* or take any action in reliance on it. If you have received this file in error, please
* immediately notify HiScene, and permanently delete the original and any copy of it and
* any printout thereof.
*
******************************************************************************************/
#include <cstdlib>
#include <cstdint>
/// supported image types
/// current version only support NV12 & NV21
typedef enum
{
HIGES_IMAGE_TYPE_8UC1 = 0, // gray image, 8 unsigned char channel 1
HIGES_IMAGE_TYPE_8UC3 = 1, // bgr image, 8 unsigned char channel 3
HIGES_IMAGE_TYPE_NV12 = 2, // yuv NV12 color image
HIGES_IMAGE_TYPE_NV21 = 3 // yuv NV21 color image
} HiGesImageType;
/// a type representing an image object. data is not managed - user manages data.
typedef struct
{
HiGesImageType type; // image type
int width; // number of columns in pixels : only support 720p image (1280x720) at present.
int height; // number of rows in pixels
unsigned char* data; // point to the first pixel in first row
int stride; // bytes between each two neighboring row heads, no padding allowed in this version (== width)
uint32_t timestamp; // the timestamp of the frame when captured in milliseconds (ms).
} HiGesImage;
/// representing a rectangle in the image, unit in pixels.
typedef struct
{
int x; // horizontal coordinate of the top left corner
int y; // vertical coordinate of the top left corner
int width; // length in horizontal direction.
int height; // length in vertical direction.
} HiGesRect;
/// HiGes bool type
typedef enum
{
HIGES_FALSE = 0,
HIGES_TRUE = 1
} HiGesBool;
/// possible trace patterns
/// all the trace patterns are defined as follows:
/// 1. user wears the camera.
/// 2. trace pattern is viewed from the perspective of user.
/// 3. not all patterns are supported at current version (-1 to 8 are supported)
typedef enum
{
HIGES_TRACE_PATTERN_ERROR = -1, // error
HIGES_TRACE_PATTERN_NONE = 0, // no trace
HIGES_TRACE_PATTERN_LEFT = 1, // moving left
HIGES_TRACE_PATTERN_RIGHT = 2, // moving right
HIGES_TRACE_PATTERN_LEFT_FAST = 3, // moving left fast
HIGES_TRACE_PATTERN_RIGHT_FAST = 4, // moving right fast
HIGES_TRACE_PATTERN_PALM2FIST = 5, // palm to fist
HIGES_TRACE_PATTERN_FIST2PALM = 6, // fist to palm
HIGES_TRACE_PATTERN_EXPAND = 7, // expand
HIGES_TRACE_PATTERN_COLLAPSE = 8, // collapse
} HiGesTracePattern;
typedef enum
{
HIGES_LOGMODE_NOMODE = 0,
HIGES_LOGMODE_DEBUG = 1,
HIGES_LOGMODE_ERROR = 2
} HiGesLogMode;
typedef enum
{
HIGES_HAND_NONE = 0, // no hand
HIGES_HAND_PALM = 1,
HIGES_HAND_FIST = 2,
HIGES_HAND_MULTI = 3
} HiGesHandType;
typedef struct {
} HiGesOptions;
/// a type representing the processing result of higes.
typedef struct
{
size_t handBBoxesCount; // [input, output] how many bboxes in the buffer. The algorithm will at most fill this many items in headBBoxes.
HiGesRect* handBBoxes; // [output] buffer pointer holds output for bboxes.
HiGesHandType handType; // [output] in this frame, which one (palm/fist) is tracked
HiGesTracePattern tracePattern; // [output] in this frame, the pattern of trace
} HiGesResult;
/// a type representing the processing result of higes.
typedef struct
{
int w[10];
int h[10];
int l[10];
int t[10];
int ws;
int hs;
int ls;
int ts;
} cReturn;