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

ScBarcodeGenerator Struct Reference

Public Member Functions

ScBarcodeGeneratorsc_barcode_generator_new (const ScRecognitionContext *context, ScSymbology symbology, ScError *out_error)
 
ScBarcodeGeneratorsc_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)
 
ScImageBuffersc_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
contextThe recognition context. Must not be null.
symbologyBarcode symbology to generate
out_errorOptional 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
contextThe recognition context. Must not be null.
symbologyBarcode symbology to generate.
json_optionsConfiguration options in JSON format.
out_errorOptional 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
generatorThe barcode generator. Must not be null.
json_optionsConfiguration options in JSON format.
out_errorOptional 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
generatorThe 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
generatorthe generator instance, must not be null
dataPointer to the beginning of the input data.
data_lengththe number of bytes of the input data.
encodingoptional array that describes what encoding to use for which part of the data. It's possible to pass NULL as this parameter.
out_errorUpon 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: