2016-03-19 02:17:09 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
// File: capi.cpp
|
|
|
|
// Description: C-API TessBaseAPI
|
|
|
|
//
|
|
|
|
// (C) Copyright 2012, Google Inc.
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
#ifndef TESS_CAPI_INCLUDE_BASEAPI
|
|
|
|
# define TESS_CAPI_INCLUDE_BASEAPI
|
|
|
|
#endif
|
|
|
|
#include "capi.h"
|
2013-09-23 23:26:50 +08:00
|
|
|
#include "genericvector.h"
|
|
|
|
#include "strngs.h"
|
2012-09-24 13:14:11 +08:00
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessVersion()
|
|
|
|
{
|
|
|
|
return TessBaseAPI::Version();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessDeleteText(char* text)
|
|
|
|
{
|
|
|
|
delete [] text;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessDeleteTextArray(char** arr)
|
|
|
|
{
|
|
|
|
for (char** pos = arr; *pos != NULL; ++pos)
|
|
|
|
delete [] *pos;
|
|
|
|
delete [] arr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessDeleteIntArray(int* arr)
|
|
|
|
{
|
|
|
|
delete [] arr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessDeleteBlockList(BLOCK_LIST* block_list)
|
|
|
|
{
|
|
|
|
TessBaseAPI::DeleteBlockList(block_list);
|
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessTextRendererCreate(const char* outputbase)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2014-05-26 05:03:11 +08:00
|
|
|
return new TessTextRenderer(outputbase);
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate(const char* outputbase)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2014-05-26 05:03:11 +08:00
|
|
|
return new TessHOcrRenderer(outputbase);
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
2014-08-04 00:22:12 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2(const char* outputbase, BOOL font_info)
|
|
|
|
{
|
|
|
|
return new TessHOcrRenderer(outputbase, font_info);
|
|
|
|
}
|
|
|
|
|
2017-01-21 04:26:34 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir,
|
2018-01-11 16:11:30 +08:00
|
|
|
BOOL textonly, int jpg_quality)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2018-01-11 16:11:30 +08:00
|
|
|
return new TessPDFRenderer(outputbase, datadir, textonly, jpg_quality);
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate(const char* outputbase)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2014-05-26 05:03:11 +08:00
|
|
|
return new TessUnlvRenderer(outputbase);
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessBoxTextRendererCreate(const char* outputbase)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2014-05-26 05:03:11 +08:00
|
|
|
return new TessBoxTextRenderer(outputbase);
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessDeleteResultRenderer(TessResultRenderer* renderer)
|
|
|
|
{
|
2015-07-19 21:15:42 +08:00
|
|
|
delete renderer;
|
2014-02-03 07:50:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessResultRendererInsert(TessResultRenderer* renderer, TessResultRenderer* next)
|
|
|
|
{
|
|
|
|
renderer->insert(next);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessResultRenderer* TESS_CALL TessResultRendererNext(TessResultRenderer* renderer)
|
|
|
|
{
|
|
|
|
return renderer->next();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument(TessResultRenderer* renderer, const char* title)
|
|
|
|
{
|
|
|
|
return renderer->BeginDocument(title);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultRendererAddImage(TessResultRenderer* renderer, TessBaseAPI* api)
|
|
|
|
{
|
|
|
|
return renderer->AddImage(api);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultRendererEndDocument(TessResultRenderer* renderer)
|
|
|
|
{
|
|
|
|
return renderer->EndDocument();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessResultRendererExtention(TessResultRenderer* renderer)
|
|
|
|
{
|
|
|
|
return renderer->file_extension();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessResultRendererTitle(TessResultRenderer* renderer)
|
|
|
|
{
|
|
|
|
return renderer->title();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessResultRendererImageNum(TessResultRenderer* renderer)
|
|
|
|
{
|
|
|
|
return renderer->imagenum();
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API TessBaseAPI* TESS_CALL TessBaseAPICreate()
|
|
|
|
{
|
|
|
|
return new TessBaseAPI;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIDelete(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
delete handle;
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice(TessBaseAPI* handle, void **device)
|
|
|
|
{
|
|
|
|
return handle->getOpenCLDevice(device);
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPISetInputName(TessBaseAPI* handle, const char* name)
|
|
|
|
{
|
|
|
|
handle->SetInputName(name);
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API const char* TESS_CALL TessBaseAPIGetInputName(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetInputName();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetInputImage(TessBaseAPI* handle, Pix* pix)
|
|
|
|
{
|
|
|
|
handle->SetInputImage(pix);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API Pix* TESS_CALL TessBaseAPIGetInputImage(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetInputImage();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetSourceYResolution();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessBaseAPIGetDatapath(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetDatapath();
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPISetOutputName(TessBaseAPI* handle, const char* name)
|
|
|
|
{
|
|
|
|
handle->SetOutputName(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPISetVariable(TessBaseAPI* handle, const char* name, const char* value)
|
|
|
|
{
|
|
|
|
return handle->SetVariable(name, value) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable(TessBaseAPI* handle, const char* name, const char* value)
|
|
|
|
{
|
|
|
|
return handle->SetVariable(name, value) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable(const TessBaseAPI* handle, const char* name, int* value)
|
|
|
|
{
|
|
|
|
return handle->GetIntVariable(name, value) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable(const TessBaseAPI* handle, const char* name, BOOL* value)
|
|
|
|
{
|
|
|
|
bool boolValue;
|
|
|
|
if (handle->GetBoolVariable(name, &boolValue))
|
|
|
|
{
|
|
|
|
*value = boolValue ? TRUE : FALSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable(const TessBaseAPI* handle, const char* name, double* value)
|
|
|
|
{
|
|
|
|
return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessBaseAPIGetStringVariable(const TessBaseAPI* handle, const char* name)
|
|
|
|
{
|
|
|
|
return handle->GetStringVariable(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIPrintVariables(const TessBaseAPI* handle, FILE* fp)
|
|
|
|
{
|
|
|
|
handle->PrintVariables(fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile(const TessBaseAPI* handle, const char* filename)
|
|
|
|
{
|
|
|
|
FILE* fp = fopen(filename, "w");
|
|
|
|
if (fp != NULL)
|
|
|
|
{
|
|
|
|
handle->PrintVariables(fp);
|
|
|
|
fclose(fp);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString(TessBaseAPI* handle, const char* name, STRING* val)
|
|
|
|
{
|
|
|
|
return handle->GetVariableAsString(name, val) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
2014-02-01 18:36:40 +08:00
|
|
|
TESS_API int TESS_CALL TessBaseAPIInit4(TessBaseAPI* handle, const char* datapath, const char* language,
|
2014-02-03 07:50:47 +08:00
|
|
|
TessOcrEngineMode mode, char** configs, int configs_size,
|
|
|
|
char** vars_vec, char** vars_values, size_t vars_vec_size,
|
|
|
|
BOOL set_only_non_debug_params)
|
|
|
|
{
|
|
|
|
GenericVector<STRING> varNames;
|
|
|
|
GenericVector<STRING> varValues;
|
|
|
|
if (vars_vec != NULL && vars_values != NULL) {
|
|
|
|
for (size_t i = 0; i < vars_vec_size; i++) {
|
|
|
|
varNames.push_back(STRING(vars_vec[i]));
|
|
|
|
varValues.push_back(STRING(vars_values[i]));
|
|
|
|
}
|
|
|
|
}
|
2014-02-01 18:36:40 +08:00
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
return handle->Init(datapath, language, mode, configs, configs_size, &varNames, &varValues, set_only_non_debug_params);
|
2014-02-01 18:36:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API int TESS_CALL TessBaseAPIInit1(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem,
|
|
|
|
char** configs, int configs_size)
|
|
|
|
{
|
|
|
|
return handle->Init(datapath, language, oem, configs, configs_size, NULL, NULL, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem)
|
|
|
|
{
|
|
|
|
return handle->Init(datapath, language, oem);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIInit3(TessBaseAPI* handle, const char* datapath, const char* language)
|
|
|
|
{
|
|
|
|
return handle->Init(datapath, language);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetInitLanguagesAsString();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
GenericVector<STRING> languages;
|
|
|
|
handle->GetLoadedLanguagesAsVector(&languages);
|
|
|
|
char** arr = new char*[languages.size() + 1];
|
|
|
|
for (int index = 0; index < languages.size(); ++index)
|
|
|
|
arr[index] = languages[index].strdup();
|
|
|
|
arr[languages.size()] = NULL;
|
|
|
|
return arr;
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:20:23 +08:00
|
|
|
TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
GenericVector<STRING> languages;
|
|
|
|
handle->GetAvailableLanguagesAsVector(&languages);
|
|
|
|
char** arr = new char*[languages.size() + 1];
|
|
|
|
for (int index = 0; index < languages.size(); ++index)
|
|
|
|
arr[index] = languages[index].strdup();
|
|
|
|
arr[languages.size()] = NULL;
|
|
|
|
return arr;
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI* handle, const char* datapath, const char* language)
|
|
|
|
{
|
|
|
|
return handle->InitLangMod(datapath, language);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
handle->InitForAnalysePage();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIReadConfigFile(TessBaseAPI* handle, const char* filename)
|
|
|
|
{
|
|
|
|
handle->ReadConfigFile(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile(TessBaseAPI* handle, const char* filename)
|
|
|
|
{
|
|
|
|
handle->ReadDebugConfigFile(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetPageSegMode(TessBaseAPI* handle, TessPageSegMode mode)
|
|
|
|
{
|
|
|
|
handle->SetPageSegMode(mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetPageSegMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char* TESS_CALL TessBaseAPIRect(TessBaseAPI* handle, const unsigned char* imagedata,
|
|
|
|
int bytes_per_pixel, int bytes_per_line,
|
|
|
|
int left, int top, int width, int height)
|
|
|
|
{
|
|
|
|
return handle->TesseractRect(imagedata, bytes_per_pixel, bytes_per_line, left, top, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
handle->ClearAdaptiveClassifier();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI* handle, const unsigned char* imagedata, int width, int height,
|
|
|
|
int bytes_per_pixel, int bytes_per_line)
|
|
|
|
{
|
|
|
|
handle->SetImage(imagedata, width, height, bytes_per_pixel, bytes_per_line);
|
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPISetImage2(TessBaseAPI* handle, struct Pix* pix)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->SetImage(pix);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetSourceResolution(TessBaseAPI* handle, int ppi)
|
|
|
|
{
|
|
|
|
handle->SetSourceResolution(ppi);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetRectangle(TessBaseAPI* handle, int left, int top, int width, int height)
|
|
|
|
{
|
|
|
|
handle->SetRectangle(left, top, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetThresholder(TessBaseAPI* handle, TessImageThresholder* thresholder)
|
|
|
|
{
|
|
|
|
handle->SetThresholder(thresholder);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Pix* TESS_CALL TessBaseAPIGetThresholdedImage(TessBaseAPI* handle)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetThresholdedImage();
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetRegions(TessBaseAPI* handle, struct Pixa** pixa)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetRegions(pixa);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetTextlines(TessBaseAPI* handle, struct Pixa** pixa, int** blockids)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetTextlines(pixa, blockids);
|
|
|
|
}
|
|
|
|
|
2014-02-03 21:24:55 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetTextlines1(TessBaseAPI* handle, const BOOL raw_image, const int raw_padding,
|
|
|
|
struct Pixa** pixa, int** blockids, int** paraids)
|
|
|
|
{
|
|
|
|
return handle->GetTextlines(raw_image, raw_padding, pixa, blockids, paraids);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetStrips(TessBaseAPI* handle, struct Pixa** pixa, int** blockids)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetStrips(pixa, blockids);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetWords(TessBaseAPI* handle, struct Pixa** pixa)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetWords(pixa);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetConnectedComponents(TessBaseAPI* handle, struct Pixa** cc)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetConnectedComponents(cc);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetComponentImages(TessBaseAPI* handle, TessPageIteratorLevel level, BOOL text_only, struct Pixa** pixa, int** blockids)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetComponentImages(level, text_only != FALSE, pixa, blockids);
|
|
|
|
}
|
|
|
|
|
2014-02-03 21:24:55 +08:00
|
|
|
TESS_API struct Boxa*
|
|
|
|
TESS_CALL TessBaseAPIGetComponentImages1( TessBaseAPI* handle, const TessPageIteratorLevel level, const BOOL text_only,
|
|
|
|
const BOOL raw_image, const int raw_padding,
|
|
|
|
struct Pixa** pixa, int** blockids, int** paraids)
|
|
|
|
{
|
|
|
|
return handle->GetComponentImages(level, text_only != FALSE, raw_image, raw_padding, pixa, blockids, paraids);
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetThresholdedImageScaleFactor();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIDumpPGM(TessBaseAPI* handle, const char* filename)
|
|
|
|
{
|
|
|
|
handle->DumpPGM(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->AnalyseLayout();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIRecognize(TessBaseAPI* handle, ETEXT_DESC* monitor)
|
|
|
|
{
|
|
|
|
return handle->Recognize(monitor);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest(TessBaseAPI* handle, ETEXT_DESC* monitor)
|
|
|
|
{
|
|
|
|
return handle->RecognizeForChopTest(monitor);
|
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI* handle, const char* filename, const char* retry_config,
|
|
|
|
int timeout_millisec, TessResultRenderer* renderer)
|
2014-02-03 07:50:47 +08:00
|
|
|
{
|
2015-08-08 05:20:22 +08:00
|
|
|
if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
|
2014-02-03 07:50:47 +08:00
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-05-26 05:03:11 +08:00
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIProcessPage(TessBaseAPI* handle, struct Pix* pix, int page_index, const char* filename,
|
|
|
|
const char* retry_config, int timeout_millisec, TessResultRenderer* renderer)
|
2014-02-03 21:24:55 +08:00
|
|
|
{
|
|
|
|
if (handle->ProcessPage(pix, page_index, filename, retry_config, timeout_millisec, renderer))
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetIterator();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetMutableIterator();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetUTF8Text();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char* TESS_CALL TessBaseAPIGetHOCRText(TessBaseAPI* handle, int page_number)
|
|
|
|
{
|
2015-05-18 03:55:50 +08:00
|
|
|
return handle->GetHOCRText(NULL, page_number);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char* TESS_CALL TessBaseAPIGetBoxText(TessBaseAPI* handle, int page_number)
|
|
|
|
{
|
|
|
|
return handle->GetBoxText(page_number);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API char* TESS_CALL TessBaseAPIGetUNLVText(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->GetUNLVText();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPIMeanTextConf(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->MeanTextConf();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->AllWordConfidences();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr(TessBaseAPI* handle, TessPageSegMode mode, const char* wordstr)
|
|
|
|
{
|
|
|
|
return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIClear(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
handle->Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPIEnd(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
handle->End();
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API int TESS_CALL TessBaseAPIIsValidWord(TessBaseAPI* handle, const char* word)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->IsValidWord(word);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection(TessBaseAPI* handle, int* out_offset, float* out_slope)
|
|
|
|
{
|
|
|
|
return handle->GetTextDirection(out_offset, out_slope) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetDictFunc(TessBaseAPI* handle, TessDictFunc f)
|
|
|
|
{
|
|
|
|
handle->SetDictFunc(f);
|
|
|
|
}
|
|
|
|
|
2014-02-03 21:24:55 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPIClearPersistentCache(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
handle->ClearPersistentCache();
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc(TessBaseAPI* handle, TessProbabilityInContextFunc f)
|
|
|
|
{
|
|
|
|
handle->SetProbabilityInContextFunc(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIDetectOS(TessBaseAPI* handle, OSResults* results)
|
|
|
|
{
|
2016-12-08 05:21:05 +08:00
|
|
|
return FALSE; // Unsafe ABI, return FALSE always
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
2016-12-09 07:08:48 +08:00
|
|
|
TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript(TessBaseAPI* handle,
|
|
|
|
int* orient_deg, float* orient_conf, const char** script_name, float* script_conf)
|
2016-12-08 05:21:05 +08:00
|
|
|
{
|
2016-12-09 07:08:48 +08:00
|
|
|
bool success;
|
2016-12-08 05:21:05 +08:00
|
|
|
success = handle->DetectOrientationScript(orient_deg, orient_conf, script_name, script_conf);
|
2016-12-09 07:08:48 +08:00
|
|
|
return (BOOL)success;
|
2016-12-08 05:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-23 23:26:50 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob(TessBaseAPI* handle, TBLOB* blob, INT_FEATURE_STRUCT* int_features,
|
2012-09-24 13:14:11 +08:00
|
|
|
int* num_features, int* FeatureOutlineIndex)
|
|
|
|
{
|
2013-09-23 23:26:50 +08:00
|
|
|
handle->GetFeaturesForBlob(blob, int_features, num_features, FeatureOutlineIndex);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API ROW* TESS_CALL TessFindRowForBox(BLOCK_LIST* blocks, int left, int top, int right, int bottom)
|
|
|
|
{
|
|
|
|
return TessBaseAPI::FindRowForBox(blocks, left, top, right, bottom);
|
|
|
|
}
|
|
|
|
|
2013-09-23 23:26:50 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier(TessBaseAPI* handle, TBLOB* blob, int num_max_matches,
|
2012-09-24 13:14:11 +08:00
|
|
|
int* unichar_ids, float* ratings, int* num_matches_returned)
|
|
|
|
{
|
2013-09-23 23:26:50 +08:00
|
|
|
handle->RunAdaptiveClassifier(blob, num_max_matches, unichar_ids, ratings, num_matches_returned);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessBaseAPIGetUnichar(TessBaseAPI* handle, int unichar_id)
|
|
|
|
{
|
|
|
|
return handle->GetUnichar(unichar_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const TessDawg* TESS_CALL TessBaseAPIGetDawg(const TessBaseAPI* handle, int i)
|
|
|
|
{
|
|
|
|
return handle->GetDawg(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API int TESS_CALL TessBaseAPINumDawgs(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->NumDawgs();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API ROW* TESS_CALL TessMakeTessOCRRow(float baseline, float xheight, float descender, float ascender)
|
|
|
|
{
|
|
|
|
return TessBaseAPI::MakeTessOCRRow(baseline, xheight, descender, ascender);
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API TBLOB* TESS_CALL TessMakeTBLOB(struct Pix* pix)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return TessBaseAPI::MakeTBLOB(pix);
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API void TESS_CALL TessNormalizeTBLOB(TBLOB* tblob, ROW* row, BOOL numeric_mode)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
2013-09-23 23:26:50 +08:00
|
|
|
TessBaseAPI::NormalizeTBLOB(tblob, row, numeric_mode != FALSE);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem(const TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->oem();
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API void TESS_CALL TessBaseAPIInitTruthCallback(TessBaseAPI* handle, TessTruthCallback* cb)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
handle->InitTruthCallback(cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin(TessBaseAPI* handle, double margin)
|
|
|
|
{
|
|
|
|
handle->set_min_orientation_margin(margin);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessBaseGetBlockTextOrientations(TessBaseAPI* handle, int** block_orientation, bool** vertical_writing)
|
|
|
|
{
|
|
|
|
handle->GetBlockTextOrientations(block_orientation, vertical_writing);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BLOCK_LIST* TESS_CALL TessBaseAPIFindLinesCreateBlockList(TessBaseAPI* handle)
|
|
|
|
{
|
|
|
|
return handle->FindLinesCreateBlockList();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessPageIteratorDelete(TessPageIterator* handle)
|
|
|
|
{
|
|
|
|
delete handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy(const TessPageIterator* handle)
|
|
|
|
{
|
|
|
|
return new TessPageIterator(*handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API void TESS_CALL TessPageIteratorBegin(TessPageIterator* handle)
|
|
|
|
{
|
|
|
|
handle->Begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessPageIteratorNext(TessPageIterator* handle, TessPageIteratorLevel level)
|
|
|
|
{
|
|
|
|
return handle->Next(level) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf(const TessPageIterator* handle, TessPageIteratorLevel level)
|
|
|
|
{
|
|
|
|
return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement(const TessPageIterator* handle, TessPageIteratorLevel level,
|
|
|
|
TessPageIteratorLevel element)
|
|
|
|
{
|
|
|
|
return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox(const TessPageIterator* handle, TessPageIteratorLevel level,
|
|
|
|
int* left, int* top, int* right, int* bottom)
|
|
|
|
{
|
|
|
|
return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType(const TessPageIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->BlockType();
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Pix* TESS_CALL TessPageIteratorGetBinaryImage(const TessPageIterator* handle, TessPageIteratorLevel level)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
return handle->GetBinaryImage(level);
|
|
|
|
}
|
|
|
|
|
2013-04-30 01:57:21 +08:00
|
|
|
TESS_API struct Pix* TESS_CALL TessPageIteratorGetImage(const TessPageIterator* handle, TessPageIteratorLevel level, int padding,
|
2014-05-26 05:03:11 +08:00
|
|
|
struct Pix* original_image, int* left, int* top)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
2014-05-26 05:03:11 +08:00
|
|
|
return handle->GetImage(level, padding, original_image, left, top);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessPageIteratorBaseline(const TessPageIterator* handle, TessPageIteratorLevel level,
|
|
|
|
int* x1, int* y1, int* x2, int* y2)
|
|
|
|
{
|
|
|
|
return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
2014-02-03 07:50:47 +08:00
|
|
|
TESS_API void TESS_CALL TessPageIteratorOrientation(TessPageIterator* handle, TessOrientation* orientation,
|
|
|
|
TessWritingDirection* writing_direction, TessTextlineOrder* textline_order,
|
|
|
|
float* deskew_angle)
|
2012-09-24 13:14:11 +08:00
|
|
|
{
|
|
|
|
handle->Orientation(orientation, writing_direction, textline_order, deskew_angle);
|
|
|
|
}
|
|
|
|
|
2014-12-29 00:55:56 +08:00
|
|
|
TESS_API void TESS_CALL TessPageIteratorParagraphInfo(TessPageIterator* handle, TessParagraphJustification* justification,
|
2015-01-01 05:31:50 +08:00
|
|
|
BOOL *is_list_item, BOOL *is_crown, int *first_line_indent)
|
2014-12-07 21:07:14 +08:00
|
|
|
{
|
2014-12-29 00:55:56 +08:00
|
|
|
bool bool_is_list_item, bool_is_crown;
|
|
|
|
handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
|
|
|
|
if (is_list_item)
|
|
|
|
*is_list_item = bool_is_list_item ? TRUE : FALSE;
|
|
|
|
if (is_crown)
|
|
|
|
*is_crown = bool_is_crown ? TRUE : FALSE;
|
2014-12-07 21:07:14 +08:00
|
|
|
}
|
|
|
|
|
2014-12-29 00:55:56 +08:00
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API void TESS_CALL TessResultIteratorDelete(TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
delete handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy(const TessResultIterator* handle)
|
|
|
|
{
|
2013-06-03 05:25:41 +08:00
|
|
|
return new TessResultIterator(*handle);
|
2012-09-24 13:14:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator(TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
|
2014-10-15 04:46:11 +08:00
|
|
|
TESS_API TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator(const TessResultIterator* handle)
|
2014-05-03 17:29:20 +08:00
|
|
|
{
|
2014-05-04 04:21:37 +08:00
|
|
|
return new TessChoiceIterator(*handle);
|
2014-05-03 17:29:20 +08:00
|
|
|
}
|
2014-05-04 04:21:37 +08:00
|
|
|
|
2014-05-03 17:29:20 +08:00
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorNext(TessResultIterator* handle, TessPageIteratorLevel level)
|
|
|
|
{
|
|
|
|
return handle->Next(level);
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API char* TESS_CALL TessResultIteratorGetUTF8Text(const TessResultIterator* handle, TessPageIteratorLevel level)
|
|
|
|
{
|
|
|
|
return handle->GetUTF8Text(level);
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API float TESS_CALL TessResultIteratorConfidence(const TessResultIterator* handle, TessPageIteratorLevel level)
|
|
|
|
{
|
|
|
|
return handle->Confidence(level);
|
|
|
|
}
|
|
|
|
|
2014-05-17 02:35:54 +08:00
|
|
|
TESS_API const char* TESS_CALL TessResultIteratorWordRecognitionLanguage(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->WordRecognitionLanguage();
|
|
|
|
}
|
|
|
|
|
2012-09-24 13:14:11 +08:00
|
|
|
TESS_API const char* TESS_CALL TessResultIteratorWordFontAttributes(const TessResultIterator* handle, BOOL* is_bold, BOOL* is_italic,
|
|
|
|
BOOL* is_underlined, BOOL* is_monospace, BOOL* is_serif,
|
|
|
|
BOOL* is_smallcaps, int* pointsize, int* font_id)
|
|
|
|
{
|
|
|
|
bool bool_is_bold, bool_is_italic, bool_is_underlined, bool_is_monospace, bool_is_serif, bool_is_smallcaps;
|
|
|
|
const char* ret = handle->WordFontAttributes(&bool_is_bold, &bool_is_italic, &bool_is_underlined, &bool_is_monospace, &bool_is_serif,
|
|
|
|
&bool_is_smallcaps, pointsize, font_id);
|
|
|
|
if (is_bold)
|
|
|
|
*is_bold = bool_is_bold ? TRUE : FALSE;
|
|
|
|
if (is_italic)
|
|
|
|
*is_italic = bool_is_italic ? TRUE : FALSE;
|
|
|
|
if (is_underlined)
|
|
|
|
*is_underlined = bool_is_underlined ? TRUE : FALSE;
|
|
|
|
if (is_monospace)
|
|
|
|
*is_monospace = bool_is_monospace ? TRUE : FALSE;
|
|
|
|
if (is_serif)
|
|
|
|
*is_serif = bool_is_serif ? TRUE : FALSE;
|
|
|
|
if (is_smallcaps)
|
|
|
|
*is_smallcaps = bool_is_smallcaps ? TRUE : FALSE;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->WordIsFromDictionary() ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->WordIsNumeric() ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->SymbolIsSuperscript() ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->SymbolIsSubscript() ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterator* handle)
|
|
|
|
{
|
|
|
|
return handle->SymbolIsDropcap() ? TRUE : FALSE;
|
|
|
|
}
|
2014-05-03 17:29:20 +08:00
|
|
|
|
2014-05-04 04:21:37 +08:00
|
|
|
TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator* handle)
|
|
|
|
{
|
|
|
|
delete handle;
|
|
|
|
}
|
|
|
|
|
2014-05-03 17:29:20 +08:00
|
|
|
TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator* handle)
|
|
|
|
{
|
2014-05-04 04:21:37 +08:00
|
|
|
return handle->Next();
|
2014-05-03 17:29:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator* handle)
|
|
|
|
{
|
2014-05-04 04:21:37 +08:00
|
|
|
return handle->GetUTF8Text();
|
2014-05-03 17:29:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator* handle)
|
|
|
|
{
|
2014-05-04 04:21:37 +08:00
|
|
|
return handle->Confidence();
|
2014-05-03 17:29:20 +08:00
|
|
|
}
|