|
Scanbot SDK
|
| typedef struct scanbotsdk_credit_card_scanner_configuration_t scanbotsdk_credit_card_scanner_configuration_t |
scanbotsdk_credit_card_scanner_configuration_t class
Configuration for the credit card scanner.
| typedef struct scanbotsdk_credit_card_scanner_t scanbotsdk_credit_card_scanner_t |
scanbotsdk_credit_card_scanner_t class
API for credit card scanning.
Required licence feature(s): CreditCardScanner.
scanbotsdk_credit_card_scanning_result_t class
Contains the result of running the credit card scanner.
scanbotsdk_credit_card_scanning_status_t enum
The status of the scanning process.
scanbotsdk_credit_card_scanning_status_t enum
The status of the scanning process.
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_clear_result | ( | scanbotsdk_credit_card_scanner_t * | self | ) |
Clears the accumulated results. Should be called after a document has been scanned to the customers satisfaction to prevent a poisoned cache.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_t method to be called on |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_create | ( | bool | use_document_detector, |
| bool | require_expiry_date, | ||
| bool | require_cardholder_name, | ||
| scanbotsdk_result_accumulation_configuration_t * | result_accumulation_config, | ||
| bool | return_credit_card_image, | ||
| scanbotsdk_processing_mode_t | processing_mode, | ||
| scanbotsdk_credit_card_scanner_configuration_t ** | result ) |
Creates a new instance of scanbotsdk_credit_card_scanner_configuration with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| use_document_detector | If true, the document detector will be used to find where the credit card is in the input image. If false, the scanner will assume that the credit card has been pre-cropped and takes the entirety of the input image. |
Default is true
| require_expiry_date | Whether the expiry date is required for a successful scan. |
Default is true
| require_cardholder_name | Whether the cardholder name is required for a successful scan. |
Default is true
| result_accumulation_config | Configuration for how to accumulate results. The value must not be null. |
| return_credit_card_image | If true, the credit card image will be returned in creditCard field of CreditCardScanningResult. |
Default is false
| processing_mode | Scanners typically can produce better results from a single image if they are allowed to spend a longer time analyzing it. |
On the other hand, scanners can produce even better results if they can analyze multiple images of the same subject and cross-check and combine the results. The processing mode tells the scanner whether to optimize for single or multiple images of a subject.
Default is AUTO
| result | Pointer to a variable that will store the created instance of scanbotsdk_credit_card_scanner_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_create_with_defaults | ( | scanbotsdk_credit_card_scanner_configuration_t ** | result | ) |
Creates a new instance of scanbotsdk_credit_card_scanner_configuration_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_credit_card_scanner_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_free | ( | scanbotsdk_credit_card_scanner_configuration_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_credit_card_scanner_configuration_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_processing_mode | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| scanbotsdk_processing_mode_t * | processing_mode ) |
Returns value of processing_mode field of the given object.
Scanners typically can produce better results from a single image if they are allowed to spend a longer time analyzing it.
On the other hand, scanners can produce even better results if they can analyze multiple images of the same subject and cross-check and combine the results. The processing mode tells the scanner whether to optimize for single or multiple images of a subject.
Default is AUTO
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| processing_mode | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_require_cardholder_name | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool * | require_cardholder_name ) |
Returns value of require_cardholder_name field of the given object.
Whether the cardholder name is required for a successful scan.
Default is true
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| require_cardholder_name | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_require_expiry_date | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool * | require_expiry_date ) |
Returns value of require_expiry_date field of the given object.
Whether the expiry date is required for a successful scan.
Default is true
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| require_expiry_date | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_result_accumulation_config | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| scanbotsdk_result_accumulation_configuration_t ** | result_accumulation_config ) |
Returns value of result_accumulation_config field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Configuration for how to accumulate results.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| result_accumulation_config | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_return_credit_card_image | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool * | return_credit_card_image ) |
Returns value of return_credit_card_image field of the given object.
If true, the credit card image will be returned in creditCard field of CreditCardScanningResult.
Default is false
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| return_credit_card_image | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_get_use_document_detector | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool * | use_document_detector ) |
Returns value of use_document_detector field of the given object.
If true, the document detector will be used to find where the credit card is in the input image. If false, the scanner will assume that the credit card has been pre-cropped and takes the entirety of the input image.
Default is true
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t |
| use_document_detector | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_processing_mode | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| scanbotsdk_processing_mode_t | processing_mode ) |
Sets value of processing_mode field of the given object.
Scanners typically can produce better results from a single image if they are allowed to spend a longer time analyzing it.
On the other hand, scanners can produce even better results if they can analyze multiple images of the same subject and cross-check and combine the results. The processing mode tells the scanner whether to optimize for single or multiple images of a subject.
Default is AUTO
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| processing_mode | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_require_cardholder_name | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool | require_cardholder_name ) |
Sets value of require_cardholder_name field of the given object.
Whether the cardholder name is required for a successful scan.
Default is true
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| require_cardholder_name | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_require_expiry_date | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool | require_expiry_date ) |
Sets value of require_expiry_date field of the given object.
Whether the expiry date is required for a successful scan.
Default is true
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| require_expiry_date | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_result_accumulation_config | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| scanbotsdk_result_accumulation_configuration_t * | result_accumulation_config ) |
Sets value of result_accumulation_config field of the given object.
Configuration for how to accumulate results.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| result_accumulation_config | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_return_credit_card_image | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool | return_credit_card_image ) |
Sets value of return_credit_card_image field of the given object.
If true, the credit card image will be returned in creditCard field of CreditCardScanningResult.
Default is false
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| return_credit_card_image | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_configuration_set_use_document_detector | ( | scanbotsdk_credit_card_scanner_configuration_t * | self, |
| bool | use_document_detector ) |
Sets value of use_document_detector field of the given object.
If true, the document detector will be used to find where the credit card is in the input image. If false, the scanner will assume that the credit card has been pre-cropped and takes the entirety of the input image.
Default is true
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_configuration_t, the field of which will be set |
| use_document_detector | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_create | ( | scanbotsdk_credit_card_scanner_configuration_t * | configuration, |
| scanbotsdk_credit_card_scanner_t ** | result ) |
Creates a new instance of scanbotsdk_credit_card_scanner with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| configuration | The configuration to use for the scanner. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_credit_card_scanner_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_free | ( | scanbotsdk_credit_card_scanner_t * | self | ) |
Frees the memory allocated for the instance of scanbotsdk_credit_card_scanner_t. If null is passed, the function does nothing.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanner_run | ( | scanbotsdk_credit_card_scanner_t * | self, |
| scanbotsdk_image_t * | image, | ||
| scanbotsdk_credit_card_scanning_result_t ** | result ) |
Scan the credit card in the given image.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_credit_card_scanner_t method to be called on |
| image | The image to scan. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_credit_card_scanner_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_free | ( | scanbotsdk_credit_card_scanning_result_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_credit_card_scanning_result_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_credit_card | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| scanbotsdk_generic_document_t ** | credit_card ) |
Returns value of credit_card field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Generic document containing credit card data. Not present, if status is FAIL.
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| credit_card | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_detection_status | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| scanbotsdk_document_detection_status_t * | detection_status ) |
Returns value of detection_status field of the given object.
The status of the credit card detection step.
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| detection_status | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_quad | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| scanbotsdk_point_t ** | quad ) |
Returns value of quad field of the given object. The returned value is direct view into memory, no pre-allocations needed.
Coordinates of the detected credit card in the input image (clockwise from top-left).
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| quad | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_quad_normalized | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| scanbotsdk_pointf_t ** | quad_normalized ) |
Returns value of quad_normalized field of the given object. The returned value is direct view into memory, no pre-allocations needed.
Coordinates of the detected credit card in the input image (clockwise from top-left), normalized to the range [0, 1].
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| quad_normalized | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_quad_normalized_size | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| size_t * | size ) |
Returns size of quad_normalized array.
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_quad_size | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| size_t * | size ) |
Returns size of quad array.
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_result_get_scanning_status | ( | scanbotsdk_credit_card_scanning_result_t * | self, |
| scanbotsdk_credit_card_scanning_status_t * | scanning_status ) |
Returns value of scanning_status field of the given object.
The status of the credit card scanning step.
| self | Pointer to the instance of scanbotsdk_credit_card_scanning_result_t |
| scanning_status | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_credit_card_scanning_status_t_to_string | ( | scanbotsdk_credit_card_scanning_status_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_credit_card_scanning_status_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |