Skip to content

Commit

Permalink
Remove TessTruthCallback from public API
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Dec 30, 2020
1 parent b7df4bc commit 588ac3f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion include/tesseract/apitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// File: apitypes.h
// Description: Types used in both the API and internally
// Author: Ray Smith
// Created: Wed Mar 03 09:22:53 PST 2010
//
// (C) Copyright 2010, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
7 changes: 0 additions & 7 deletions include/tesseract/baseapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ using ParamsModelClassifyFunc = float (Dict::*)(const char*, void*);
using FillLatticeFunc = void (Wordrec::*)(const MATRIX&,
const WERD_CHOICE_LIST&,
const UNICHARSET&, BlamerBundle*);
using TruthCallback =
std::function<void(const UNICHARSET&, int, PageIterator*, Pix*)>;

/**
* Base class for all tesseract APIs.
Expand Down Expand Up @@ -761,10 +759,6 @@ class TESS_API TessBaseAPI {
return last_oem_requested_;
}

void InitTruthCallback(TruthCallback cb) {
truth_cb_ = cb;
}

void set_min_orientation_margin(double margin);
/* @} */

Expand Down Expand Up @@ -825,7 +819,6 @@ class TESS_API TessBaseAPI {
std::string language_; ///< Last initialized language.
OcrEngineMode last_oem_requested_; ///< Last ocr language mode requested.
bool recognition_done_; ///< page_res_ contains recognition data.
TruthCallback truth_cb_; ///< fxn for setting truth_* in WERD_RES

/**
* @defgroup ThresholderParams Thresholder Parameters
Expand Down
4 changes: 0 additions & 4 deletions include/tesseract/capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ typedef tesseract::ProbabilityInContextFunc TessProbabilityInContextFunc;
// typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc;
typedef tesseract::FillLatticeFunc TessFillLatticeFunc;
typedef tesseract::Dawg TessDawg;
typedef tesseract::TruthCallback TessTruthCallback;
typedef tesseract::Orientation TessOrientation;
typedef tesseract::ParagraphJustification TessParagraphJustification;
typedef tesseract::WritingDirection TessWritingDirection;
Expand Down Expand Up @@ -407,9 +406,6 @@ TESS_API int TessBaseAPINumDawgs(const TessBaseAPI* handle);

TESS_API TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle);

TESS_API void TessBaseAPIInitTruthCallback(TessBaseAPI* handle,
TessTruthCallback cb);

TESS_API void TessBaseGetBlockTextOrientations(TessBaseAPI* handle,
int** block_orientation,
bool** vertical_writing);
Expand Down
12 changes: 0 additions & 12 deletions src/api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ TessBaseAPI::TessBaseAPI()
page_res_(nullptr),
last_oem_requested_(OEM_DEFAULT),
recognition_done_(false),
truth_cb_(nullptr),
rect_left_(0),
rect_top_(0),
rect_width_(0),
Expand Down Expand Up @@ -857,17 +856,6 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) {
}
#endif // ndef DISABLED_LEGACY_ENGINE

if (truth_cb_ != nullptr) {
tesseract_->wordrec_run_blamer.set_value(true);
auto *page_it = new PageIterator(
page_res_, tesseract_, thresholder_->GetScaleFactor(),
thresholder_->GetScaledYResolution(),
rect_left_, rect_top_, rect_width_, rect_height_);
truth_cb_(tesseract_->getDict().getUnicharset(),
image_height_, page_it, this->tesseract()->pix_grey());
delete page_it;
}

int result = 0;
if (tesseract_->interactive_display_mode) {
#ifndef GRAPHICS_DISABLED
Expand Down
5 changes: 0 additions & 5 deletions src/api/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,6 @@ TessOcrEngineMode TessBaseAPIOem(const TessBaseAPI* handle) {
return handle->oem();
}

void TessBaseAPIInitTruthCallback(TessBaseAPI* handle,
TessTruthCallback cb) {
handle->InitTruthCallback(cb);
}

void TessBaseAPISetMinOrientationMargin(TessBaseAPI* handle,
double margin) {
handle->set_min_orientation_margin(margin);
Expand Down

0 comments on commit 588ac3f

Please sign in to comment.