ScBarcode Struct Reference

Public Member Functions

ScByteArray sc_barcode_get_data (ScBarcode const *barcode)
 
ScEncodingArray sc_barcode_get_data_encoding (ScBarcode const *barcode)
 
void sc_barcode_retain (ScBarcode *barcode)
 
void sc_barcode_release (ScBarcode *barcode)
 
ScSymbology sc_barcode_get_symbology (ScBarcode const *barcode)
 
ScBool sc_barcode_is_gs1_data_carrier (ScBarcode const *barcode)
 
ScCompositeFlag sc_barcode_get_composite_flag (ScBarcode const *barcode)
 
ScBool sc_barcode_is_recognized (ScBarcode const *barcode)
 
ScQuadrilateral sc_barcode_get_location (ScBarcode const *barcode)
 
uint32_t sc_barcode_get_frame_id (ScBarcode const *barcode)
 
int32_t sc_barcode_get_symbol_count (ScBarcode const *barcode)
 
ScBool sc_barcode_is_color_inverted (ScBarcode const *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
Examples:
CommandLineBarcodeScannerCameraSample.c, CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.

Member Function Documentation

ScByteArray sc_barcode_get_data ( ScBarcode const *  barcode)

Get the data encoded in the barcode.

Parameters
barcodeThe 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
Examples:
CommandLineBarcodeScannerCameraSample.c, CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.
ScEncodingArray sc_barcode_get_data_encoding ( ScBarcode const *  barcode)

Get the data encodings.

Parameters
barcodeThe 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
barcodeThe barcode object. Must not 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
barcodeThe barcode object. May be null.
Since
4.6.0
ScSymbology sc_barcode_get_symbology ( ScBarcode const *  barcode)

Get the symbology of the barcode.

Parameters
barcodethe 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:
CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.
ScBool sc_barcode_is_gs1_data_carrier ( ScBarcode const *  barcode)

Check whether the barcode is a "GS1" code.

Parameters
barcodethe 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
barcodethe 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
ScBool sc_barcode_is_recognized ( ScBarcode const *  barcode)

Check whether the barcode was fully decoded (recognized).

Parameters
barcodeThe barcode object. Must not be null.
Returns
True for barcodes whose data was successfully decoded and false otherwise.
Since
4.6.0
Examples:
CommandLineMatrixScanCameraSample.c.
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
barcodeThe 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
barcodeThe 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
barcodeThe barcode object. Must not be null.
Returns
the symbol count or -1 if no symbol count exist for this symbology.
Since
4.12.0
ScBool sc_barcode_is_color_inverted ( ScBarcode const *  barcode)

Get the color of the barcode.

Parameters
barcodeThe 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: