Public Member Functions | |
ScBarcodeGenerator * | sc_barcode_generator_new (ScRecognitionContext const *context, ScSymbology symbology, ScError *out_error) |
ScBarcodeGenerator * | sc_barcode_generator_new_with_options (ScRecognitionContext const *context, ScSymbology symbology, char const *json_options, ScError *out_error) |
void | sc_barcode_generator_set_options (ScBarcodeGenerator *generator, char const *json_options, ScError *out_error) |
void | sc_barcode_generator_free (ScBarcodeGenerator *generator) |
ScImageBuffer * | sc_barcode_generator_generate (ScBarcodeGenerator const *generator, uint8_t const *data, size_t data_length, ScEncodingArray const 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 | ( | ScRecognitionContext const * | 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 | ( | ScRecognitionContext const * | context, |
ScSymbology | symbology, | ||
char const * | 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, |
char const * | 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 | ( | ScBarcodeGenerator const * | generator, |
uint8_t const * | data, | ||
size_t | data_length, | ||
ScEncodingArray const | 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 RGBA generated by the barcode generator.
- Since
- 5.8.0
The documentation for this struct was generated from the following file: