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
Public Member Functions | |
ScByteArray | sc_barcode_get_data (const ScBarcode *barcode) |
ScEncodingArray | sc_barcode_get_data_encoding (const ScBarcode *barcode) |
void | sc_barcode_retain (ScBarcode *barcode) |
void | sc_barcode_release (ScBarcode *barcode) |
ScSymbology | sc_barcode_get_symbology (const ScBarcode *barcode) |
ScBool | sc_barcode_is_gs1_data_carrier (const ScBarcode *barcode) |
ScCompositeFlag | sc_barcode_get_composite_flag (const ScBarcode *barcode) |
ScBool | sc_barcode_is_recognized (const ScBarcode *barcode) |
ScQuadrilateral | sc_barcode_get_location (const ScBarcode *barcode) |
uint32_t | sc_barcode_get_frame_id (const ScBarcode *barcode) |
int32_t | sc_barcode_get_symbol_count (const ScBarcode *barcode) |
ScBool | sc_barcode_is_color_inverted (const ScBarcode *barcode) |
Detailed Description
A located or recognized barcode/ 2d code in an image.
Barcode objects represent 1d and 2d codes in images. They can either represent barcodes that were completely decoded (recognized), or barcodes that were just localized in the image.
- Since
- 4.6.0
Member Function Documentation
ScByteArray sc_barcode_get_data | ( | const ScBarcode * | barcode | ) |
Get the data encoded in the barcode.
- Parameters
-
barcode The barcode object. Must not be null.
The lifetime of the string is bound to the lifetime of the barcode object. It is only safe to access the byte array as long as the barcode object exists, e.g. before calling sc_barcode_release().
The data of recognized barcodes is always terminated with a nul-byte. For symbologies that support encoding binary data, nul-characters may appear in the middle. Use sc_barcode_get_data_length() to get the complete length of barcode data for such symbologies.
- Returns
- The data encoded in the barcode. For barcodes that were located in the frame but not recognized, an empty array is returned.
- Since
- 4.6.0
ScEncodingArray sc_barcode_get_data_encoding | ( | const ScBarcode * | barcode | ) |
Get the data encodings.
- Parameters
-
barcode The barcode object. Must not be null.
The lifetime of the barcode data is bound to the lifetime of the barcode object. It is only safe to access the encoding array as long as the barcode object exists, e.g. before calling sc_barcode_release().
The array itself has to be freed manually using sc_encoding_array_free().
- Returns
- The data encoding of the data in the barcode. For barcodes that were located in the frame but not recognized, an empty array is returned.
- Since
- 5.0.0
void sc_barcode_retain | ( | ScBarcode * | barcode | ) |
Increase reference count of barcode object by one.
- Parameters
-
barcode The barcode object. Must no be null.
- Since
- 4.6.0
void sc_barcode_release | ( | ScBarcode * | barcode | ) |
Decrease reference count of barcode object by one.
When the reference count drops to zero, the barcode object is deallocated.
- Parameters
-
barcode The barcode object. May be null.
- Since
- 4.6.0
ScSymbology sc_barcode_get_symbology | ( | const ScBarcode * | barcode | ) |
Get the symbology of the barcode.
- Parameters
-
barcode the barcode object. Must not be null.
- Returns
- The symbology of the barcode. For barcodes that were located in the frame but not recognized, SC_SYMBOLOGY_UNKNOWN is returned.
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerDemo.c.
Check whether the barcode is a "GS1" code.
- Parameters
-
barcode the barcode object. Must not be null
- Returns
- True if the barcode is a GS1 code, false otherwise. In case sc_barcode_is_recognized() returns false, false is returned.
A GS1 data carrier stores appication identifiers as defined by de GS1 General Specification.
- Since
- 4.6.0
ScCompositeFlag sc_barcode_get_composite_flag | ( | const ScBarcode * | barcode | ) |
Flag to hint whether the barcode is part of a composite code.
- Parameters
-
barcode the barcode object. Must not be null
- Returns
- a single composite flag. If no barcode was recognized SC_COMPOSITE_FLAG_UNKNOWN is returned.
- Since
- 4.14.0
Check whether the barcode was fully decoded (recognized).
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- True for barcodes whose data was successfully decoded and false otherwise.
- Since
- 4.6.0
ScQuadrilateral sc_barcode_get_location | ( | const ScBarcode * | barcode | ) |
Get the location of a recognized or located barcode.
- Returns
- The location of the barcode in the image.
- Parameters
-
barcode The barcode object. Must not be null.
The location is a polygon with 4 corners. The top_left corner corresponds to the top-left in the coordinate system of the barcode. When the barcode stands "on the head", e.g. it is decoded from right to left, the top_left corner corresponds to the bottom-right corner in the image.
- Since
- 4.6.0
uint32_t sc_barcode_get_frame_id | ( | const ScBarcode * | barcode | ) |
Get the frame ID a barcode was found in.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- The frame ID of the image where the barcode was found in.
- Since
- 4.6.0
int32_t sc_barcode_get_symbol_count | ( | const ScBarcode * | barcode | ) |
Get the symbol count of the barcode.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- the symbol count or -1 if no symbol count exist for this symbology.
- Since
- 4.12.0
Get the color of the barcode.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- true if the barcode is white on black background. False indicates that the barcode is black on a white background or no barcode was found.
- Since
- 5.5.0
The documentation for this struct was generated from the following file: