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 | ( | ScBarcode const * | 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 null-byte. For symbologies that support encoding binary data, null-characters may appear in the middle. Use sc_byte_array_get_size() to get the complete size 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 | ( | ScBarcode const * | 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 const * | barcode | ) |
Increase reference count of barcode object by one.
- Parameters
-
barcode The barcode object. Must not be null.
- Since
- 4.6.0
| void sc_barcode_release | ( | ScBarcode const * | 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 | ( | ScBarcode const * | 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
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 | ( | ScBarcode const * | 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 | ( | ScBarcode const * | 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 | ( | ScBarcode const * | 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 | ( | ScBarcode const * | 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 module count of a scanned code.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- The barcode module counts in x and y direction or -1 if no barcode could be decoded successfully or not implemented.
The interpretation of the module x and y count is symbology specific.
- 1d symbologies: The x dimension correspons to the number of unit bars in barcode direction. The y count is always -1.
- 2d symbologies like DataMatrix or QR: The x and y dimension is the number of modules in each dimension.
- Stacked symbologies like PDF417 or DataBar: The x dimension correspons to the number of unit bars in barcode direction. The y count corresponds to the number of rows.
- Since
- 7.5.0
| char const * sc_barcode_get_file_id | ( | ScBarcode const * | barcode | ) |
Get the file ID of the barcode.
The file ID is part of the structured append feature of (Micro)PDF417 (aka Macro PDP417). All segments with the same file ID belong together.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- The ID of the file the barcode belongs to. An empty string is returned if no file ID is attached to the barcode.
- Since
- 7.6.0
| int32_t sc_barcode_get_segment_index | ( | ScBarcode const * | barcode | ) |
Get the segment index of the barcode.
The segment index is part of the structured append feature of (Micro)PDF417 (aka Macro PDF417), QR, Aztec and DataMatrix. The segment index corresponds to this barcode content's relative position within the distributed file. The number of segments of the file the barcode belongs to can be obtained with sc_barcode_get_segment_count.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- The segment index of the barcode. Returns -1 in case that no segment index is attached to the barcode, i.e. the barcode does not belong to a file.
- Since
- 7.6.0
| int32_t sc_barcode_get_segment_count | ( | ScBarcode const * | barcode | ) |
Get the segment count of the file the barcode belongs to.
The segment count is part of the structured append feature of (Micro)PDF417 (aka Macro PDF417), QR, Aztec and DataMatrix. The segment count states the number of segments the file is split into.
- Parameters
-
barcode The barcode object. Must not be null.
- Returns
- The segment count. Returns -1 in case that the barcode does not belong to a file.
- Since
- 7.6.0
The documentation for this struct was generated from the following file: