|
13 | 13 | #endif |
14 | 14 |
|
15 | 15 | #include"DynamsoftCaptureVisionRouter.h" |
16 | | -#define DISA_VERSION "2.0.30.4532" |
| 16 | +#define DISA_VERSION "2.0.60.5318" |
17 | 17 |
|
18 | 18 | #ifdef __cplusplus |
19 | 19 |
|
@@ -452,6 +452,31 @@ namespace dynamsoft { |
452 | 452 | * @return Returns 0 if succeeds, nonzero otherwise. |
453 | 453 | */ |
454 | 454 | int SaveToMemory(const CImageData* pImageData, ImageFileFormat imageFormat, unsigned char** imageFileBytes, int* imageFileBytesLength); |
| 455 | + |
| 456 | + |
| 457 | + /** |
| 458 | + * Reads an image from a Base64-encoded string. |
| 459 | + * |
| 460 | + * @param [in] base64String A null-terminated string containing the Base64-encoded image data. |
| 461 | + * @param [out] pErrorCode A pointer to an integer to receive the error code, if any. Defaults to NULL. |
| 462 | + * |
| 463 | + * @return Returns a pointer to a CImageData object representing the image if successful, or nullptr if an error occurs. |
| 464 | + * @remarks If the file format is gif, pdf or tiff, we read the first page of the image file.The caller is responsible for freeing the memory allocated for the image. |
| 465 | + */ |
| 466 | + CImageData* ReadFromBase64String(const char* base64String, int* pErrorCode = NULL); |
| 467 | + |
| 468 | + |
| 469 | + /** |
| 470 | + * Saves an image to a Base64-encoded string. |
| 471 | + * |
| 472 | + * @param [in] pImageData A pointer to the image data to be saved. |
| 473 | + * @param [in] imageFormat The image file format to be saved. |
| 474 | + * @param [out] base64String A pointer to a char* that will hold the Base64-encoded string. |
| 475 | + * |
| 476 | + * @return Returns an integer indicating the success of the operation. 0 indicates success, while a non-zero value indicates an error occurred. |
| 477 | + * @remarks The caller is responsible for freeing the memory allocated for the Base64-encoded string. |
| 478 | + */ |
| 479 | + int SaveToBase64String(const CImageData* pImageData, ImageFileFormat imageFormat, char** base64String); |
455 | 480 | }; |
456 | 481 |
|
457 | 482 | class UTIL_API CImageDrawer { |
@@ -501,7 +526,28 @@ namespace dynamsoft { |
501 | 526 | * If the specified rectangle or quadrilateral exceeds the image boundaries, white will be used to fill the exceeding area. |
502 | 527 | */ |
503 | 528 | CImageData* CropImage(const CImageData* pImageData, const CRect& rect, int* pErrorCode = NULL); |
| 529 | + /** |
| 530 | + * Announced as deprecated. Use CropAndDeskewImage instead. |
| 531 | + */ |
504 | 532 | CImageData* CropImage(const CImageData* pImageData, const CQuadrilateral& quad, int* pErrorCode = NULL); |
| 533 | + |
| 534 | + /** |
| 535 | + * Crops and deskews a region from the input image based on the specified quadrilateral. |
| 536 | + * @param [in] imageData The source image to be cropped and deskewed. |
| 537 | + * @param [in] quad A quadrilateral defining the region of interest to extract. |
| 538 | + * @param [in] dstWidth (Optional) The width of the output image. If set to 0, the width and height will be automatically calculated. |
| 539 | + * @param [in] dstHeight (Optional) The height of the output image. If set to 0, the width and height will be automatically calculated. |
| 540 | + * @param [in] padding (Optional) Extra padding (in pixels) applied to expand the boundaries of the extracted region. Default is 0. |
| 541 | + * @param [out] errorCode The error code. |
| 542 | + * |
| 543 | + * @return Returns a pointer to a new CImageData object containing the cropped and deskewed image. |
| 544 | + * |
| 545 | + * @remarks The caller is responsible for freeing the memory allocated for the cropped image. |
| 546 | + * The function will automatically calculate the perspective transform matrix and use it to crop the image. |
| 547 | + * If the specified quadrilateral exceeds the image boundaries, white will be used to fill the exceeding area. |
| 548 | + */ |
| 549 | + CImageData* CropAndDeskewImage(const CImageData* pImageData, const CQuadrilateral& quad, |
| 550 | + int dstWidth = 0, int dstHeight = 0, int padding = 0, int* pErrorCode = NULL); |
505 | 551 | /** |
506 | 552 | * Adjusts the brightness of the image. |
507 | 553 | * @param pImageData: Input colour image. |
|
0 commit comments