3DiVi Face SDK  3.24.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups
RawImage.h
1 #import <Foundation/Foundation.h>
2 #import <AVFoundation/AVFoundation.h>
3 
4 
15 typedef NS_ENUM(int32_t, Format){
21  FORMAT_GRAY = 0,
22 
28  FORMAT_RGB = 1,
29 
35  FORMAT_BGR = 2,
36 
42  FORMAT_YUV_NV21 = 3,
43 
49  FORMAT_YUV_NV12 = 4
50 };
51 
52 
58 @interface Rectangle : NSObject
59 {
60  int x;
61  int y;
62  int width;
63  int height;
64 }
65 
71 -(nonnull instancetype) init: (int) X : (int) Y : (int) Width : (int) Height;
72 
78 @property int x;
79 
85 @property int y;
86 
92 @property int width;
93 
99 @property int height;
100 
101 @end
102 
103 
104 
113 @interface RawImage : NSObject
114 {
115  void *raw_image;
116  int width;
117  int height;
118  const unsigned char * data;
119 }
120 
127 -(nonnull instancetype) init: (int) width : (int) height : (int) format : (const unsigned char *_Nullable) data;
128 
135 -(nonnull instancetype) init: (void *_Nonnull)image;
136 -(nonnull instancetype) init;
137 
144 -(nonnull instancetype) init: (CMSampleBufferRef _Nullable)sampleBuffer : (int) format;
145 
146 -(void) dealloc;
147 
157 -(nonnull RawImage*) crop: (Rectangle *_Nonnull) rec;
158 
159 @property (readonly ,nonnull) void *raw_image;
160 
167 @property (readonly) int width;
168 
175 @property (readonly) int height;
176 
188 @property (readonly, nonnull) const unsigned char * data;
189 
190 @end
191 
192 
int width
Width of the rectangle.
Definition: RawImage.h:62
int x
X coordinate of the top-left corner.
Definition: RawImage.h:60
typedef NS_ENUM(int32_t, Format)
Format of image data.
Definition: RawImage.h:15
int y
Y coordinate of the top-left corner.
Definition: RawImage.h:61
int height
Image height.
Definition: RawImage.h:117
const unsigned char * data
Pointer to the image data buffer. All pixels must be stored continuously, row by row, without gaps at the end of each row.
Definition: RawImage.h:118
int height
Height of the rectangle.
Definition: RawImage.h:63
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:113
int width
Image width.
Definition: RawImage.h:116
Rectangle in an image.
Definition: RawImage.h:58