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
Go to the source code of this file.
Typedefs | |
typedef struct ScOpaqueBarcodeGenerator | ScBarcodeGenerator |
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
Functions for generating barcode images.
- Copyright
- Copyright (c) 2018 Scandit AG. All rights reserved.
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
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
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
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
ScImageBuffer* sc_barcode_generator_generate | ( | const ScBarcodeGenerator * | generator, |
const uint8_t * | data, | ||
size_t | data_length, | ||
const ScEncodingArray | encoding, | ||
ScError * | out_error | ||
) |
Generates a n image containing a barcode encoding the provided data.
- Parameters
-
generator the generator instance, must not be null data Pointer to the beginning of data. data_length the number of bytes of the 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