Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Multi page image extractor

Typedefs

typedef struct scanbotsdk_multi_page_image_extractor_t scanbotsdk_multi_page_image_extractor_t
 scanbotsdk_multi_page_image_extractor_t class
 
typedef struct scanbotsdk_extracted_image_metadata_t scanbotsdk_extracted_image_metadata_t
 scanbotsdk_extracted_image_metadata_t class
 
typedef struct scanbotsdk_extracted_image_t scanbotsdk_extracted_image_t
 scanbotsdk_extracted_image_t class
 
typedef struct scanbotsdk_extracted_page_t scanbotsdk_extracted_page_t
 scanbotsdk_extracted_page_t class
 
typedef struct scanbotsdk_page_extraction_result_t scanbotsdk_page_extraction_result_t
 scanbotsdk_page_extraction_result_t class
 

Functions

SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_create (scanbotsdk_multi_page_image_extractor_t **result)
 Creates a new instance of scanbotsdk_multi_page_image_extractor with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_free (scanbotsdk_multi_page_image_extractor_t *self)
 Frees the memory allocated for the instance of scanbotsdk_multi_page_image_extractor_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_run (scanbotsdk_multi_page_image_extractor_t *self, scanbotsdk_random_access_source_t *source, scanbotsdk_page_extraction_result_t **result)
 Extracts images from the given source. If possible, images that are originally stored in a compressed way, are not decompressed automatically but are initialized in a lazy way. This means that the image data is only decompressed when it is accessed for the first time. That's why when the images are used after extraction, it is recommended to close (dispose) (if platform uses Garbage Collector) images as soon as they are not needed anymore to prevent storing a lot of images in decompressed state in memory. After the method is executed, the source doesn't have to exist anymore.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_create (int height, int width, scanbotsdk_extracted_image_metadata_t **result)
 Creates a new instance of scanbotsdk_extracted_image_metadata with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_free (scanbotsdk_extracted_image_metadata_t *object)
 Frees the memory allocated for the instance of scanbotsdk_extracted_image_metadata_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_get_height (scanbotsdk_extracted_image_metadata_t *self, int *height)
 Returns value of height field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_get_width (scanbotsdk_extracted_image_metadata_t *self, int *width)
 Returns value of width field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_free (scanbotsdk_extracted_image_t *object)
 Frees the memory allocated for the instance of scanbotsdk_extracted_image_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_get_image (scanbotsdk_extracted_image_t *self, scanbotsdk_image_t **image)
 Returns value of image field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_get_metadata (scanbotsdk_extracted_image_t *self, scanbotsdk_extracted_image_metadata_t **metadata)
 Returns value of metadata field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_free (scanbotsdk_extracted_page_t *object)
 Frees the memory allocated for the instance of scanbotsdk_extracted_page_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_get_images (scanbotsdk_extracted_page_t *self, scanbotsdk_extracted_image_t **images, size_t size)
 Returns value of images field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_get_images_size (scanbotsdk_extracted_page_t *self, size_t *size)
 Returns size of images array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_free (scanbotsdk_page_extraction_result_t *object)
 Frees the memory allocated for the instance of scanbotsdk_page_extraction_result_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_get_pages (scanbotsdk_page_extraction_result_t *self, scanbotsdk_extracted_page_t **pages, size_t size)
 Returns value of pages field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_get_pages_size (scanbotsdk_page_extraction_result_t *self, size_t *size)
 Returns size of pages array.
 

Detailed Description

Typedef Documentation

◆ scanbotsdk_extracted_image_metadata_t

scanbotsdk_extracted_image_metadata_t class

The metadata is taken from the PDF stream's dictionary, not from the image header inside the stream. In a well-formed PDF file, the image metadata encoded in the stream dictionary should be the same as the one encoded in the image header. This, however, is neither required nor checked and may not be true for an ill-formed PDF.

◆ scanbotsdk_extracted_image_t

scanbotsdk_extracted_image_t class

An image extracted from a multipage image.

◆ scanbotsdk_extracted_page_t

scanbotsdk_extracted_page_t class

A single page extracted from a multipage image.

◆ scanbotsdk_multi_page_image_extractor_t

scanbotsdk_multi_page_image_extractor_t class

API for extracting images from multi-page images (PDF, TIFF) and single-page images (JPEG, PNG).

Required licence feature(s): ImageProcessing.

◆ scanbotsdk_page_extraction_result_t

scanbotsdk_page_extraction_result_t class

Result of the extraction of pages from a multipage image.

Function Documentation

◆ scanbotsdk_extracted_image_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_free ( scanbotsdk_extracted_image_t * object)

Frees the memory allocated for the instance of scanbotsdk_extracted_image_t. If null is passed, the function does nothing.

Parameters
objectPointer to the instance of scanbotsdk_extracted_image_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_extracted_image_get_image()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_get_image ( scanbotsdk_extracted_image_t * self,
scanbotsdk_image_t ** image )

Returns value of image field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

The extracted image.

Parameters
selfPointer to the instance of scanbotsdk_extracted_image_t
imagePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_extracted_image_get_metadata()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_get_metadata ( scanbotsdk_extracted_image_t * self,
scanbotsdk_extracted_image_metadata_t ** metadata )

Returns value of metadata field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Metadata of the extracted image.

Parameters
selfPointer to the instance of scanbotsdk_extracted_image_t
metadataPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_extracted_image_metadata_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_create ( int height,
int width,
scanbotsdk_extracted_image_metadata_t ** result )

Creates a new instance of scanbotsdk_extracted_image_metadata 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.

Parameters
heightHeight of the image in pixels.
widthWidth of the image in pixels.
resultPointer to a variable that will store the created instance of scanbotsdk_extracted_image_metadata_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_extracted_image_metadata_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_free ( scanbotsdk_extracted_image_metadata_t * object)

Frees the memory allocated for the instance of scanbotsdk_extracted_image_metadata_t. If null is passed, the function does nothing.

Parameters
objectPointer to the instance of scanbotsdk_extracted_image_metadata_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_extracted_image_metadata_get_height()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_get_height ( scanbotsdk_extracted_image_metadata_t * self,
int * height )

Returns value of height field of the given object.

Height of the image in pixels.

Parameters
selfPointer to the instance of scanbotsdk_extracted_image_metadata_t
heightPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_extracted_image_metadata_get_width()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_image_metadata_get_width ( scanbotsdk_extracted_image_metadata_t * self,
int * width )

Returns value of width field of the given object.

Width of the image in pixels.

Parameters
selfPointer to the instance of scanbotsdk_extracted_image_metadata_t
widthPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_extracted_page_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_free ( scanbotsdk_extracted_page_t * object)

Frees the memory allocated for the instance of scanbotsdk_extracted_page_t. If null is passed, the function does nothing.

Parameters
objectPointer to the instance of scanbotsdk_extracted_page_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_extracted_page_get_images()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_get_images ( scanbotsdk_extracted_page_t * self,
scanbotsdk_extracted_image_t ** images,
size_t size )

Returns value of images field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

List of images extracted from the page.

Parameters
selfPointer to the instance of scanbotsdk_extracted_page_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
imagesPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_extracted_page_get_images_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_extracted_page_get_images_size ( scanbotsdk_extracted_page_t * self,
size_t * size )

Returns size of images array.

Parameters
selfPointer to the instance of scanbotsdk_extracted_page_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_multi_page_image_extractor_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_create ( scanbotsdk_multi_page_image_extractor_t ** result)

Creates a new instance of scanbotsdk_multi_page_image_extractor 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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_multi_page_image_extractor_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_multi_page_image_extractor_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_free ( scanbotsdk_multi_page_image_extractor_t * self)

Frees the memory allocated for the instance of scanbotsdk_multi_page_image_extractor_t. If null is passed, the function does nothing.

Parameters
selfPointer to the instance of scanbotsdk_multi_page_image_extractor_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_multi_page_image_extractor_run()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_multi_page_image_extractor_run ( scanbotsdk_multi_page_image_extractor_t * self,
scanbotsdk_random_access_source_t * source,
scanbotsdk_page_extraction_result_t ** result )

Extracts images from the given source. If possible, images that are originally stored in a compressed way, are not decompressed automatically but are initialized in a lazy way. This means that the image data is only decompressed when it is accessed for the first time. That's why when the images are used after extraction, it is recommended to close (dispose) (if platform uses Garbage Collector) images as soon as they are not needed anymore to prevent storing a lot of images in decompressed state in memory. After the method is executed, the source doesn't have to exist anymore.

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.

Parameters
selfPointer to the instance of scanbotsdk_multi_page_image_extractor_t method to be called on
sourceThe source to extract images from. Supported multi-page image formats are TIFF and PDF. Supported single page image formats are JPEG and PNG. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_multi_page_image_extractor_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_page_extraction_result_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_free ( scanbotsdk_page_extraction_result_t * object)

Frees the memory allocated for the instance of scanbotsdk_page_extraction_result_t. If null is passed, the function does nothing.

Parameters
objectPointer to the instance of scanbotsdk_page_extraction_result_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_page_extraction_result_get_pages()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_get_pages ( scanbotsdk_page_extraction_result_t * self,
scanbotsdk_extracted_page_t ** pages,
size_t size )

Returns value of pages field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

List of extracted pages.

Parameters
selfPointer to the instance of scanbotsdk_page_extraction_result_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
pagesPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_page_extraction_result_get_pages_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_extraction_result_get_pages_size ( scanbotsdk_page_extraction_result_t * self,
size_t * size )

Returns size of pages array.

Parameters
selfPointer to the instance of scanbotsdk_page_extraction_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.