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,
275 
285 SC_EXPORT const char* sc_get_information_string(ScInformationKey key);
286 
292 typedef struct {
293  ScImageDescription* description;
294  uint8_t* data;
295 } ScImageBuffer;
296 
307 SC_EXPORT void
309 
310 
311 #if defined(__cplusplus)
312 }
313 #endif
314 
315 
316 #endif //SC_COMMON_H_
317 
318 
ScErrorType
Enumeration of different error types.
Definition: ScCommon.h:243
uint32_t height
y dimension
Definition: ScCommon.h:141
the camera cannot change its focus
Definition: ScCommon.h:208
const char * message
error message. Set to NULL in case there is no error
Definition: ScCommon.h:230
ScInformationKey
Enumeration of different information strings.
Definition: ScCommon.h:272
ScQuadrilateral sc_quadrilateral_make(ScPoint tl, ScPoint tr, ScPoint br, ScPoint bl)
Helper function to initialize a quadrilateral with 4 corners.
void sc_error_free(ScError *error)
free's any memory associated with the error
ScPointF position
Upper-left corner of the rectangle.
Definition: ScCommon.h:167
ScPoint bottom_right
Bottom right corner of the quadrilateral.
Definition: ScCommon.h:77
the focus capabilities are not known
Definition: ScCommon.h:207
A 2-dimensional polygon with 4 corners.
Definition: ScCommon.h:65
float y
Y-coordinate.
Definition: ScCommon.h:112
float width
x dimension
Definition: ScCommon.h:150
A 2-dimensional bitmap/image.
Definition: ScCommon.h:292
ScPoint top_right
Top right corner of the quadrilateral.
Definition: ScCommon.h:73
Describes dimensions as well as internal memory layout of an image buffer.
A 2-dimensional point with integer precision.
Definition: ScCommon.h:28
ScPointF sc_rectangle_f_get_center(ScRectangleF rectangle)
Calculates and returns the center of the rectangle.
float x
X-coordinate.
Definition: ScCommon.h:108
ScRectangleF sc_rectangle_f_make(float position_x, float position_y, float width, float height)
Helper function to initialize a rectangle.
ScPointF sc_point_f_make(float x, float y)
Helper function to initialize a point with x, y coordinates.
Definition: ScCommon.h:127
Structure for holding error information.
Definition: ScCommon.h:226
void sc_free(void *pointer)
Deallocates the memory allocation pointed to by pointer.
the camera is controlled by the user
Definition: ScCommon.h:210
ScPoint sc_point_make(int x, int y)
Helper function to initialize a point with x, y coordinates.
Definition: ScCommon.h:52
Common definitions used throughout the ScanditSDK API.
const char * sc_get_information_string(ScInformationKey key)
Get information string.
int32_t x
X-coordinate.
Definition: ScCommon.h:32
A 2-dimensional unsigned size.
Definition: ScCommon.h:139
uint32_t code
error code, 0 if there is no error, a positive value otherwise.
Definition: ScCommon.h:235
A 2-dimensional rectangle with floating point precision.
Definition: ScCommon.h:163
ScCameraFocusMode
Describes the focus mode of a camera.
Definition: ScCommon.h:206
ScPoint bottom_left
Bottom left corner of the quadrilateral.
Definition: ScCommon.h:81
int32_t y
Y-coordinate.
Definition: ScCommon.h:36
the camera automatically adjusts the focus to create a sharp image
Definition: ScCommon.h:209
float height
y dimension
Definition: ScCommon.h:151
void sc_image_buffer_free(ScImageBuffer *image)
Frees the data contained in the image.
ScPoint top_left
Top left corner of the quadrilateral.
Definition: ScCommon.h:69
Image Description interface.
ScSizeF size
Width and height of the rectangle. Both must larger or equal than zero.
Definition: ScCommon.h:171
A 2-dimensional size with floating point precision.
Definition: ScCommon.h:149
uint32_t width
x dimension
Definition: ScCommon.h:140
A 2-dimensional point with floating point precision.
Definition: ScCommon.h:104