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 | |
ScBarcodeGenerator * | sc_barcode_generator_new (const ScRecognitionContext *context, ScSymbology symbology, ScError *out_error) |
ScBarcodeGenerator * | sc_barcode_generator_new_with_options (const ScRecognitionContext *context, ScSymbology symbology, const char *json_options, ScError *out_error) |
void | sc_barcode_generator_set_options (ScBarcodeGenerator *generator, const char *json_options, ScError *out_error) |
void | sc_barcode_generator_free (ScBarcodeGenerator *generator) |
ScImageBuffer * | sc_barcode_generator_generate (const ScBarcodeGenerator *generator, const uint8_t *data, size_t data_length, const ScEncodingArray encoding, ScError *out_error) |
Detailed Description
A 1d/2d barcode generator.
Barcode generators are classes that encode a sequence of bytes into an image in the form of a barcode/2d code that then can be read by a barcode scanner.
- Since
- 5.8.0
Member Function Documentation
ScBarcodeGenerator * sc_barcode_generator_new | ( | const ScRecognitionContext * | context, |
ScSymbology | symbology, | ||
ScError * | out_error | ||
) |
Create a new barcode generator instance for the given symbology.
The barcode generator is initialized with default options for the symbology. If you want to pass other options during construction, use sc_barcode_generator_new_with_options.
- Parameters
-
context The recognition context. Must not be null. symbology Barcode symbology to generate out_error Optional error output object. Can be null.
Upon failure, out_error is filled with a more specific reason for failure and must be freed again using sc_error_free.
- Returns
- The newly created generator, or null in case of error.
- Since
- 5.8.0
ScBarcodeGenerator * sc_barcode_generator_new_with_options | ( | const ScRecognitionContext * | context, |
ScSymbology | symbology, | ||
const char * | json_options, | ||
ScError * | out_error | ||
) |
Create a new barcode generator instance for the given symbology and options.
- Parameters
-
context The recognition context. Must not be null. symbology Barcode symbology to generate. json_options Configuration options in JSON format. out_error Optional error output object. Can be null.
Upon failure, out_error is filled with a more specific reason for failure and must be freed again using sc_error_free.
- Returns
- The newly created generator, or null in case of error.
- Since
- 5.8.0
void sc_barcode_generator_set_options | ( | ScBarcodeGenerator * | generator, |
const char * | json_options, | ||
ScError * | out_error | ||
) |
sets the options on a given barcode generator
- Parameters
-
generator The barcode generator. Must not be null. json_options Configuration options in JSON format. out_error Optional error output object. Can be null.
Upon failure, out_error is filled with a more specific reason for failure and must be freed again using sc_error_free.
- Since
- 5.8.0
For a description of the JSON format understood by this function, see Barcode Generator Settings JSON format.
void sc_barcode_generator_free | ( | ScBarcodeGenerator * | generator | ) |
Free a previously instantiated barcode generator. May be null.
- Parameters
-
generator The barcode generator to free. Can be null.
- Since
- 5.8.0
ScImageBuffer * sc_barcode_generator_generate | ( | const ScBarcodeGenerator * | generator, |
const uint8_t * | data, | ||
size_t | data_length, | ||
const ScEncodingArray | encoding, | ||
ScError * | out_error | ||
) |
Generates an image containing a barcode encoding the provided data.
- Parameters
-
generator the generator instance, must not be null data Pointer to the beginning of the input data. data_length the number of bytes of the input data. encoding optional array that describes what encoding to use for which part of the data. It's possible to pass NULL as this parameter. out_error Upon failure contains a more detailed reason for failure. In case of error, this must be freed again using sc_error_free.
- Returns
- The image generated by the barcode generator.
- Since
- 5.8.0
The documentation for this struct was generated from the following file: