Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for Android

ScCommon.h
Go to the documentation of this file.
1 
11 #ifndef SC_COMMON_H_
12 #define SC_COMMON_H_
13 
14 
15 #include <Scandit/ScConfig.h>
17 
18 #if defined(__cplusplus)
19 extern "C" {
20 #endif
21 
22 
28 typedef struct {
32  int32_t x;
36  int32_t y;
37 } ScPoint;
38 
39 
52 inline ScPoint sc_point_make(int x, int y) {
53  ScPoint point;
54  point.x = x;
55  point.y = y;
56  return point;
57 }
58 
59 
65 typedef struct {
83 
84 
96 SC_EXPORT ScQuadrilateral
98 
104 typedef struct {
108  float x;
112  float y;
113 } ScPointF;
114 
127 inline ScPointF sc_point_f_make(float x, float y) {
128  ScPointF point;
129  point.x = x;
130  point.y = y;
131  return point;
132 }
133 
139 typedef struct {
140  uint32_t width;
141  uint32_t height;
142 } ScSize;
143 
149 typedef struct {
150  float width;
151  float height;
152 } ScSizeF;
153 
163 typedef struct {
172 } ScRectangleF;
173 
186 SC_EXPORT ScRectangleF
187 sc_rectangle_f_make(float position_x, float position_y, float width, float height);
188 
198 SC_EXPORT ScPointF
200 
206 typedef enum {
212 
219 SC_EXPORT void sc_free(void *pointer);
220 
226 typedef struct {
230  const char *message;
231 
235  uint32_t code;
236 } ScError;
237 
243 typedef enum {
244  SC_NO_ERROR = 0,
245  SC_ERROR_UNKNOWN = 1,
246  SC_ERROR_NOT_IMPLEMENTED = 2,
247  SC_ERROR_INVALID_INPUT = 3,
248  SC_ERROR_INTERNAL_ERROR = 4
249 } ScErrorType;
250 
251 
261 SC_EXPORT void sc_error_free(ScError *error);
262 
263 
272 typedef enum {
273  SC_INFORMATION_KEY_SOFTWARE_LICENSES = 0,
274  SC_INFORMATION_KEY_SDK_VERSION = 1,
275  SC_INFORMATION_KEY_SDK_BUILD = 2,
277 
287 SC_EXPORT const char* sc_get_information_string(ScInformationKey key);
288 
294 typedef struct {
295  ScImageDescription* description;
296  uint8_t* data;
297 } ScImageBuffer;
298 
309 SC_EXPORT void
311 
312 
313 #if defined(__cplusplus)
314 }
315 #endif
316 
317 #endif // SC_COMMON_H_
Image Description interface.
ScCameraFocusMode
Describes the focus mode of a camera.
Definition: ScCommon.h:206
ScQuadrilateral sc_quadrilateral_make(ScPoint tl, ScPoint tr, ScPoint br, ScPoint bl)
Helper function to initialize a quadrilateral with 4 corners.
ScPoint top_right
Top right corner of the quadrilateral.
Definition: ScCommon.h:73
ScRectangleF sc_rectangle_f_make(float position_x, float position_y, float width, float height)
Helper function to initialize a rectangle.
A 2-dimensional point with floating point precision.
Definition: ScCommon.h:104
float width
x dimension
Definition: ScCommon.h:150
Structure for holding error information.
Definition: ScCommon.h:226
ScSizeF size
Width and height of the rectangle. Both must larger or equal than zero.
Definition: ScCommon.h:171
@ SC_CAMERA_FOCUS_MODE_AUTO
the camera automatically adjusts the focus to create a sharp image
Definition: ScCommon.h:209
A 2-dimensional bitmap/image.
Definition: ScCommon.h:294
const char * message
error message. Set to NULL in case there is no error
Definition: ScCommon.h:230
@ SC_CAMERA_FOCUS_MODE_MANUAL
the camera is controlled by the user
Definition: ScCommon.h:210
ScPointF sc_rectangle_f_get_center(ScRectangleF rectangle)
Calculates and returns the center of the rectangle.
int32_t x
X-coordinate.
Definition: ScCommon.h:32
A 2-dimensional polygon with 4 corners.
Definition: ScCommon.h:65
void sc_image_buffer_free(ScImageBuffer *image)
Frees the data contained in the image.
Common definitions used throughout the ScanditSDK API.
float x
X-coordinate.
Definition: ScCommon.h:108
uint32_t width
x dimension
Definition: ScCommon.h:140
ScPointF position
Upper-left corner of the rectangle.
Definition: ScCommon.h:167
ScPointF sc_point_f_make(float x, float y)
Helper function to initialize a point with x, y coordinates.
Definition: ScCommon.h:127
const char * sc_get_information_string(ScInformationKey key)
Get information string.
@ SC_CAMERA_FOCUS_MODE_UNKNOWN
the focus capabilities are not known
Definition: ScCommon.h:207
void sc_error_free(ScError *error)
free's any memory associated with the error
void sc_free(void *pointer)
Deallocates the memory allocation pointed to by pointer.
Describes dimensions as well as internal memory layout of an image buffer.
A 2-dimensional point with integer precision.
Definition: ScCommon.h:28
ScInformationKey
Enumeration of different information strings.
Definition: ScCommon.h:272
A 2-dimensional unsigned size.
Definition: ScCommon.h:139
ScPoint bottom_right
Bottom right corner of the quadrilateral.
Definition: ScCommon.h:77
ScPoint bottom_left
Bottom left corner of the quadrilateral.
Definition: ScCommon.h:81
ScPoint top_left
Top left corner of the quadrilateral.
Definition: ScCommon.h:69
A 2-dimensional rectangle with floating point precision.
Definition: ScCommon.h:163
ScErrorType
Enumeration of different error types.
Definition: ScCommon.h:243
A 2-dimensional size with floating point precision.
Definition: ScCommon.h:149
ScPoint sc_point_make(int x, int y)
Helper function to initialize a point with x, y coordinates.
Definition: ScCommon.h:52
float y
Y-coordinate.
Definition: ScCommon.h:112
uint32_t height
y dimension
Definition: ScCommon.h:141
@ SC_CAMERA_FOCUS_MODE_FIXED
the camera cannot change its focus
Definition: ScCommon.h:208
float height
y dimension
Definition: ScCommon.h:151
uint32_t code
error code, 0 if there is no error, a positive value otherwise.
Definition: ScCommon.h:235
int32_t y
Y-coordinate.
Definition: ScCommon.h:36