Skip to content

Commit 6776f9f

Browse files
Kyrylocyrillicw
authored andcommitted
Improve c wrapper comments
1 parent ce09ed4 commit 6776f9f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

examples/c/barcode/live/main.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ scanbotsdk_error_code_t process_frame(scanbotsdk_barcode_scanner_t *scanner, fra
8383
scanbotsdk_barcode_scanner_result_t *result = NULL;
8484

8585
// region create scanbotsdk_image_t from frame
86+
87+
// Setting image_is_live lets the scanner know that we're running in live mode.
88+
// In this mode we maintain the highest FPS because we spread the work of scanning barcodes across multiple frames.
89+
// If you set image_is_live = false, the scanner will run in single-shot mode which is much slower,
90+
// but has a much higher probability of finding all barcodes in the input image.
91+
// As an alternative, you can explicitly set the scanner mode,
92+
// by creating it with e.g. SCANBOTSDK_PROCESSING_MODE_LIVE for live mode instead of SCANBOTSDK_PROCESSING_MODE_AUTO.
8693
bool image_is_live = true;
8794
scanbotsdk_raw_image_load_options_create_with_defaults(image_is_live, &image_load_options);
8895

@@ -129,7 +136,7 @@ scanbotsdk_error_code_t create_barcode_scanner(bool use_tensor_rt, scanbotsdk_ba
129136
scanbotsdk_error_code_t ec = SCANBOTSDK_OK;
130137

131138
scanbotsdk_barcode_format_common_configuration_t *common_format_configuration = NULL;
132-
scanbotsdk_accelerator_t* accelerator = NULL;
139+
scanbotsdk_accelerator_t *accelerator = NULL;
133140
scanbotsdk_barcode_scanner_configuration_t *barcode_scanner_configuration = NULL;
134141

135142
// region create barcode scanner configuration
@@ -172,6 +179,12 @@ scanbotsdk_error_code_t create_barcode_scanner(bool use_tensor_rt, scanbotsdk_ba
172179
goto exit;
173180
}
174181

182+
ec = scanbotsdk_barcode_scanner_configuration_set_processing_mode(
183+
barcode_scanner_configuration, SCANBOTSDK_PROCESSING_MODE_AUTO);
184+
if (ec != SCANBOTSDK_OK) {
185+
goto exit;
186+
}
187+
175188
if (use_tensor_rt) {
176189
scanbotsdk_tensor_rt_accelerator_t *tensor_rt_accelerator = NULL;
177190
ec = scanbotsdk_tensor_rt_accelerator_create("./", &tensor_rt_accelerator);

examples/c/barcode/minimal/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ scanbotsdk_error_code_t process_image(scanbotsdk_barcode_scanner_t *scanner, con
1717
scanbotsdk_barcode_scanner_result_t *result = NULL;
1818

1919
// region create scanbotsdk_image_t from frame
20-
bool image_is_live = true;
2120
scanbotsdk_path_image_load_options_create_with_defaults(&image_load_options);
2221

2322
ec = scanbotsdk_image_create_from_path(path, image_load_options, &image);

0 commit comments

Comments
 (0)