SRSDK  0.10.39
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#pragma once
2
3#include "leia/common/slice.h"
4#include "leia/common/log.h"
5
6#include <stdint.h>
7
9
10typedef int32_t leia_bool;
11
12typedef void (*leia_free_user_data_cb)(void* userData);
13
14#pragma pack(push, 8)
15
20
29
31};
32
34 double ms;
36};
37
39 uint8_t const* data;
40 int32_t width;
41 int32_t height;
42 int32_t reserved0; /* Must be set to 0. */
43 int32_t reserved1; /* Must be set to 0. */
44};
45
46#define LEIA_IS_IMAGE_DESC_VALID(d) ((d).data && (d).width && (d).height && (d).reserved0 == 0 && (d).reserved1 == 0)
47
49 int32_t width; /* Width of the image in pixels */
50 int32_t height; /* Height of the image in pixels */
51 float ppx; /* Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge */
52 float ppy; /* Vertical coordinate of the principal point of the image, as a pixel offset from the top edge */
53 float fx; /* Focal length of the image plane, as a multiple of pixel width */
54 float fy; /* Focal length of the image plane, as a multiple of pixel height */
55 double distortionCoeffs[8]; /* Distortion coefficients */
56 leia_bool isMirrored; /* Whether the image is mirrored or not */
57};
58
60 float fx; /* Horizontal normalized coordinate of the principal point of the image, as an offset from the left edge */
61 float fy; /* Vertical normalized coordinate of the principal point of the image, as an offset from the top edge */
62 float ppx; /* Horizontal focal length of the image plane normalized by the width */
63 float ppy; /* Vertical focal length of the image plane normalized by the height */
64 float distortionCoeffs[8]; /* Distortion coefficients, OpenCV-style */
65};
66
68 double x;
69 double y;
70};
71
73 double x;
74 double y;
75 double z;
76};
77
79 union {
80 struct {
81 float x;
82 float y;
83 float z;
84 };
85 float v[3];
86 };
87};
88
90 union {
91 struct {
92 float x;
93 float y;
94 float z;
95 float w;
96 };
97 float v[4];
98 };
99};
100
101struct leia_mat4 {
102 union {
103 struct leia_vector4 col[4];
104 float m[16];
105 };
106};
107
115
118
125 char id[16];
126 char reserved[32];
127};
128
130inline const char* leia_orientation_to_ui_str(enum leia_orientation orientation)
131{
132 switch (orientation)
133 {
135 return "Landscape";
137 return "Portrait";
139 return "ReverseLandscape";
141 return "ReversePortrait";
142 default:
143 return "Unknown";
144 }
145}
146
149{
150 struct leia_float_slice ret;
151 ret.data = v->v;
152 ret.length = 3;
153 return ret;
154}
157{
158 struct leia_float_slice ret;
159 ret.data = v->v;
160 ret.length = 4;
161 return ret;
162}
165{
166 struct leia_float_slice ret;
167 ret.data = v->m;
168 ret.length = 16;
169 return ret;
170}
171
172#pragma pack(pop)
173
BEGIN_CAPI_DECL typedef int32_t leia_bool
Definition types.h:10
LEIA_NODISCARD const char * leia_orientation_to_ui_str(enum leia_orientation orientation)
Definition types.h:130
LEIA_NODISCARD struct leia_float_slice leia_vector3_to_slice(struct leia_vector3 *v)
Definition types.h:148
leia_orientation
Definition types.h:108
@ LEIA_ORIENTATION_LANDSCAPE
Definition types.h:110
@ LEIA_ORIENTATION_UNSPECIFIED
Definition types.h:109
@ LEIA_ORIENTATION_REVERSE_PORTRAIT
Definition types.h:113
@ LEIA_ORIENTATION_COUNT
Definition types.h:114
@ LEIA_ORIENTATION_PORTRAIT
Definition types.h:111
@ LEIA_ORIENTATION_REVERSE_LANDSCAPE
Definition types.h:112
@ _LEIA_ORIENTATION_MAKE_ENUM_32BIT
Definition types.h:116
void(* leia_free_user_data_cb)(void *userData)
Definition types.h:12
LEIA_NODISCARD struct leia_float_slice leia_mat4_to_slice(struct leia_mat4 *v)
Definition types.h:164
LEIA_NODISCARD struct leia_float_slice leia_vector4_to_slice(struct leia_vector4 *v)
Definition types.h:156
leia_timestamp_space
Definition types.h:16
@ _LEIA_TIMESTAMP_SPACE_MAKE_ENUM_32BIT
Definition types.h:30
@ LEIA_TIMESTAMP_SPACE_UNKNOWN
Definition types.h:19
@ LEIA_TIMESTAMP_SPACE_SYSTEM
Definition types.h:28
#define LEIA_NODISCARD
Definition defines.h:86
#define END_CAPI_DECL
Definition defines.h:74
#define BEGIN_CAPI_DECL
Definition defines.h:73
Definition types.h:48
int32_t width
Definition types.h:49
float fx
Definition types.h:53
float fy
Definition types.h:54
int32_t height
Definition types.h:50
leia_bool isMirrored
Definition types.h:56
float ppx
Definition types.h:51
float ppy
Definition types.h:52
double distortionCoeffs[8]
Definition types.h:55
Definition types.h:119
char reserved[32]
Definition types.h:126
struct leia_camera_intrinsics intrinsics
Definition types.h:120
struct leia_vector3 translation_mm
Definition types.h:121
enum leia_orientation sensorOrientation
Definition types.h:123
leia_bool frontFacing
Definition types.h:124
struct leia_vector3 rotation_deg
Definition types.h:122
Definition slice.h:12
float * data
Definition slice.h:13
int32_t length
Definition slice.h:14
Definition types.h:38
int32_t width
Definition types.h:40
int32_t reserved0
Definition types.h:42
int32_t height
Definition types.h:41
uint8_t const * data
Definition types.h:39
int32_t reserved1
Definition types.h:43
Definition types.h:101
struct leia_vector4 col[4]
Definition types.h:103
float m[16]
Definition types.h:104
float fx
Definition types.h:60
float fy
Definition types.h:61
float distortionCoeffs[8]
Definition types.h:64
float ppx
Definition types.h:62
float ppy
Definition types.h:63
Definition types.h:33
enum leia_timestamp_space space
Definition types.h:35
double ms
Definition types.h:34
Definition types.h:67
double y
Definition types.h:69
double x
Definition types.h:68
Definition types.h:78
float v[3]
Definition types.h:85
float y
Definition types.h:82
float x
Definition types.h:81
float z
Definition types.h:83
Definition types.h:72
double z
Definition types.h:75
double y
Definition types.h:74
double x
Definition types.h:73
Definition types.h:89
float v[4]
Definition types.h:97
float w
Definition types.h:95
float y
Definition types.h:93
float x
Definition types.h:92
float z
Definition types.h:94