HOCR_SDK_runAsyncBase64
Included header
#include <HOCR_SDK_COMMON.h>
Description
Asynchronous engine module execution API; request is sent as a base64 string, results are delivered via callback
HOCR_SDK_runAsyncBase64()
|
- Parameters
-
Name Type Description obj void* Pointer to 'ArgoEngineApi' object
callback HOCR_SDK_RUN_RESULT_CALLBACK Function pointer to receive engine module execution results via callback
openApiName char* Name of the engine module to use
requestId char* Request ID (value to identify the request)
imgWidth int Image width
imgHeight int Image height
colorSpace int Image color type
Note: RGB 0, RGBA 1, BGR 2, BGRA 3, YUV 4, GRAY 5
imgData char* Image pixel data
Note: String data containing the base64 encoding of the raw pixel data already decoded by an image processing library, etc.
requestOptionJsonStr char* JSON string to set options of the engine module obtained via HOCR_SDK_getOpenApiOption
- Return value
None
Examples
void resultCallbackFunc(char* resultJsonStr, int resultJsonLength) {
std::string callbackResultJson = std::string(resultJsonStr, resultJsonLength);
std::cout << callbackResultJson << std::endl;
}
std::string openApiName = "TEXT_RECOGNITION";
std::string requestId = "random-string";
int width = 1024;
int height = 768;
char *base64 = "...";
std::string requestOptionJsonStr = "{}";
int resultSize = HOCR_SDK_runAsyncBase64(
obj,
&resultCallbackFunc,
openApiName.data(),
requestId.data(),
width,
height,
2, /* RGB 0, RGBA 1, BGR 2, BGRA 3, YUV 4, GRAY 5 */
base64,
requestOptionJsonStr.data()
);
std::string resultJson(resultJsonStr, resultSize);