Clean public API for renderers

- Remove unused type definitions for TessTextRenderer, ... in capi.h
  (they were only used in capi.cpp which now no longer needs them)

- Fix typo in comment

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2019-12-02 15:48:18 +01:00
parent 39cc7b5808
commit 420cbac876
3 changed files with 11 additions and 25 deletions

View File

@ -47,15 +47,6 @@ extern "C" {
#ifdef TESS_CAPI_INCLUDE_BASEAPI
typedef tesseract::TessResultRenderer TessResultRenderer;
typedef tesseract::TessTextRenderer TessTextRenderer;
typedef tesseract::TessHOcrRenderer TessHOcrRenderer;
typedef tesseract::TessAltoRenderer TessAltoRenderer;
typedef tesseract::TessTsvRenderer TessTsvRenderer;
typedef tesseract::TessPDFRenderer TessPDFRenderer;
typedef tesseract::TessUnlvRenderer TessUnlvRenderer;
typedef tesseract::TessBoxTextRenderer TessBoxTextRenderer;
typedef tesseract::TessWordStrBoxRenderer TessWordStrBoxRenderer;
typedef tesseract::TessLSTMBoxRenderer TessLSTMBoxRenderer;
typedef tesseract::TessBaseAPI TessBaseAPI;
typedef tesseract::PageIterator TessPageIterator;
typedef tesseract::ResultIterator TessResultIterator;
@ -78,11 +69,6 @@ typedef tesseract::TextlineOrder TessTextlineOrder;
typedef PolyBlockType TessPolyBlockType;
#else
typedef struct TessResultRenderer TessResultRenderer;
typedef struct TessTextRenderer TessTextRenderer;
typedef struct TessHOcrRenderer TessHOcrRenderer;
typedef struct TessPDFRenderer TessPDFRenderer;
typedef struct TessUnlvRenderer TessUnlvRenderer;
typedef struct TessBoxTextRenderer TessBoxTextRenderer;
typedef struct TessBaseAPI TessBaseAPI;
typedef struct TessPageIterator TessPageIterator;
typedef struct TessResultIterator TessResultIterator;

View File

@ -143,7 +143,7 @@ class TESS_API TessResultRenderer {
private:
const char* file_extension_; // standard extension for generated output
STRING title_; // title of document being renderered
STRING title_; // title of document being rendered
int imagenum_; // index of last image added
FILE* fout_; // output file pointer

View File

@ -49,52 +49,52 @@ void TessDeleteBlockList(BLOCK_LIST* block_list) {
TessResultRenderer*
TessTextRendererCreate(const char* outputbase) {
return new TessTextRenderer(outputbase);
return new tesseract::TessTextRenderer(outputbase);
}
TessResultRenderer*
TessHOcrRendererCreate(const char* outputbase) {
return new TessHOcrRenderer(outputbase);
return new tesseract::TessHOcrRenderer(outputbase);
}
TessResultRenderer*
TessHOcrRendererCreate2(const char* outputbase, BOOL font_info) {
return new TessHOcrRenderer(outputbase, font_info != 0);
return new tesseract::TessHOcrRenderer(outputbase, font_info != 0);
}
TessResultRenderer*
TessAltoRendererCreate(const char* outputbase) {
return new TessAltoRenderer(outputbase);
return new tesseract::TessAltoRenderer(outputbase);
}
TessResultRenderer*
TessTsvRendererCreate(const char* outputbase) {
return new TessTsvRenderer(outputbase);
return new tesseract::TessTsvRenderer(outputbase);
}
TessResultRenderer* TessPDFRendererCreate(
const char* outputbase, const char* datadir, BOOL textonly) {
return new TessPDFRenderer(outputbase, datadir, textonly != 0);
return new tesseract::TessPDFRenderer(outputbase, datadir, textonly != 0);
}
TessResultRenderer*
TessUnlvRendererCreate(const char* outputbase) {
return new TessUnlvRenderer(outputbase);
return new tesseract::TessUnlvRenderer(outputbase);
}
TessResultRenderer*
TessBoxTextRendererCreate(const char* outputbase) {
return new TessBoxTextRenderer(outputbase);
return new tesseract::TessBoxTextRenderer(outputbase);
}
TessResultRenderer*
TessWordStrBoxRendererCreate(const char* outputbase) {
return new TessWordStrBoxRenderer(outputbase);
return new tesseract::TessWordStrBoxRenderer(outputbase);
}
TessResultRenderer*
TessLSTMBoxRendererCreate(const char* outputbase) {
return new TessLSTMBoxRenderer(outputbase);
return new tesseract::TessLSTMBoxRenderer(outputbase);
}
void TessDeleteResultRenderer(TessResultRenderer* renderer) {