Merge pull request #1765 from stweil/includes

Add missing include statements and clean some include statements
This commit is contained in:
Egor Pugin 2018-07-07 19:59:33 +03:00 committed by GitHub
commit cfa787d976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 372 additions and 227 deletions

View File

@ -22,8 +22,9 @@
#include "config_auto.h" #include "config_auto.h"
#endif #endif
#include "baseapi.h"
#ifdef __linux__ #ifdef __linux__
#include <signal.h> #include <signal.h> // for sigaction, SA_RESETHAND, SIGBUS, SIGFPE
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)
@ -34,49 +35,58 @@
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#else #else
#include <dirent.h> #include <dirent.h> // for closedir, opendir, readdir, DIR, dirent
#include <libgen.h> #include <libgen.h>
#include <cstring>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h> // for stat, S_IFDIR
#include <unistd.h> #include <unistd.h>
#endif // _WIN32 #endif // _WIN32
#include <algorithm> #include <clocale> // for LC_ALL, LC_CTYPE, LC_NUMERIC
#include <clocale> #include <cmath> // for round, M_PI
#include <fstream> #include <cstdint> // for int32_t
#include <iostream> #include <cstring> // for strcmp, strcpy
#include <iterator> #include <fstream> // for size_t
#include <memory> // std::unique_ptr #include <iostream> // for std::cin
#include <string> #include <memory> // for std::unique_ptr
#include "allheaders.h" // for pixDestroy, boxCreate, boxaAddBox, box...
#include "allheaders.h" #include "blobclass.h" // for ExtractFontName
#include "boxword.h" // for BoxWord
#include "baseapi.h" #include "config_auto.h" // for PACKAGE_VERSION
#include "blobclass.h" #include "coutln.h" // for C_OUTLINE_IT, C_OUTLINE_LIST
#include "resultiterator.h" #include "dawg_cache.h" // for DawgCache
#include "mutableiterator.h" #include "dict.h" // for Dict
#include "thresholder.h" #include "edgblob.h" // for extract_edges
#include "tesseractclass.h" #include "elst.h" // for ELIST_ITERATOR, ELISTIZE, ELISTIZEH
#include "pageres.h" #include "environ.h" // for l_uint8, FALSE, TRUE
#include "paragraphs.h" #include "equationdetect.h" // for EquationDetect
#include "tessvars.h" #include "errcode.h" // for ASSERT_HOST
#include "control.h" #include "globaloc.h" // for SavePixForCrash, signal_exit
#include "dict.h" #include "helpers.h" // for IntCastRounded, chomp_string
#include "pgedit.h" #include "host.h" // for BOOL8
#include "paramsd.h" #include "imageio.h" // for IFF_TIFF_G4, IFF_TIFF, IFF_TIFF_G3
#include "output.h" #include "intfx.h" // for INT_FX_RESULT_STRUCT
#include "globaloc.h" #include "mutableiterator.h" // for MutableIterator
#include "globals.h" #include "normalis.h" // for kBlnBaselineOffset, kBlnXHeight
#include "edgblob.h" #include "ocrclass.h" // for ETEXT_DESC
#include "equationdetect.h" #include "openclwrapper.h" // for PERF_COUNT_END, PERF_COUNT_START, PERF...
#include "makerow.h" #include "osdetect.h" // for OSResults, OSBestResult, OrientationId...
#include "otsuthr.h" #include "pageres.h" // for PAGE_RES_IT, WERD_RES, PAGE_RES, CR_DE...
#include "osdetect.h" #include "paragraphs.h" // for DetectParagraphs
#include "params.h" #include "params.h" // for BoolParam, IntParam, DoubleParam, Stri...
#include "renderer.h" #include "pdblock.h" // for PDBLK
#include "strngs.h" #include "points.h" // for FCOORD
#include "openclwrapper.h" #include "polyblk.h" // for POLY_BLOCK
#include "rect.h" // for TBOX
#include "renderer.h" // for TessResultRenderer
#include "resultiterator.h" // for ResultIterator
#include "stepblob.h" // for C_BLOB_IT, C_BLOB, C_BLOB_LIST
#include "strngs.h" // for STRING
#include "tessdatamanager.h" // for TessdataManager, kTrainedDataSuffix
#include "tesseractclass.h" // for Tesseract
#include "thresholder.h" // for ImageThresholder
#include "tprintf.h" // for tprintf
#include "werd.h" // for WERD, WERD_IT, W_FUZZY_NON, W_FUZZY_SP
BOOL_VAR(stream_filelist, FALSE, "Stream a filelist from stdin"); BOOL_VAR(stream_filelist, FALSE, "Stream a filelist from stdin");

View File

@ -23,7 +23,6 @@
// and hide includes of complex types in baseapi.cpp. // and hide includes of complex types in baseapi.cpp.
#include "genericvector.h" #include "genericvector.h"
#include "platform.h" #include "platform.h"
#include "publictypes.h"
namespace tesseract { namespace tesseract {

View File

@ -23,14 +23,14 @@
#include "config_auto.h" #include "config_auto.h"
#endif #endif
#include <algorithm>
#include <cstring>
#include <cmath> #include <cmath>
#include <cstdint> // for int16_t, int32_t
#include <cstdio> // for fclose, fopen, FILE
#include <ctime> // for clock
#ifdef __UNIX__ #ifdef __UNIX__
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <ctype.h> #include <cctype>
#include <errno.h>
#include "callcpp.h" #include "callcpp.h"
#include "control.h" #include "control.h"
#ifndef DISABLED_LEGACY_ENGINE #ifndef DISABLED_LEGACY_ENGINE
@ -42,6 +42,7 @@
#include "lstmrecognizer.h" #include "lstmrecognizer.h"
#include "ocrclass.h" #include "ocrclass.h"
#include "output.h" #include "output.h"
#include "pageres.h" // for WERD_RES, PAGE_RES_IT, PAGE_RES, BLO...
#include "pgedit.h" #include "pgedit.h"
#include "reject.h" #include "reject.h"
#include "sorthelper.h" #include "sorthelper.h"

View File

@ -19,15 +19,30 @@
* *
**********************************************************************/ **********************************************************************/
#include <ctype.h>
#include "reject.h"
#include "statistc.h"
#include "control.h"
#include "fixspace.h" #include "fixspace.h"
#include "genblob.h" #include <cstdint> // for INT16_MAX, int16_t, int32_t
#include "tessvars.h" #include "blobs.h" // for TWERD, TBLOB, TESSLINE
#include "globals.h" #include "boxword.h" // for BoxWord
#include "tesseractclass.h" #include "errcode.h" // for ASSERT_HOST
#include "genblob.h" // for c_blob_comparator
#include "host.h" // for FALSE, TRUE
#include "normalis.h" // for kBlnXHeight, kBlnBaselineOffset
#include "ocrclass.h" // for ETEXT_DESC
#include "pageres.h" // for WERD_RES_IT, WERD_RES, WERD_RES_LIST
#include "params.h" // for IntParam, StringParam, BoolParam, Doub...
#include "ratngs.h" // for WERD_CHOICE, FREQ_DAWG_PERM, NUMBER_PERM
#include "rect.h" // for TBOX
#include "stepblob.h" // for C_BLOB_IT, C_BLOB_LIST, C_BLOB
#include "strngs.h" // for STRING
#include "tesseractclass.h" // for Tesseract, TesseractStats, WordData
#include "tessvars.h" // for debug_fp
#include "tprintf.h" // for tprintf
#include "unichar.h" // for UNICHAR_ID
#include "unicharset.h" // for UNICHARSET
#include "werd.h" // for WERD, W_EOL, W_FUZZY_NON, W_FUZZY_SP
class BLOCK;
class ROW;
#define PERFECT_WERDS 999 #define PERFECT_WERDS 999
#define MAXSPACING 128 /*max expected spacing in pix */ #define MAXSPACING 128 /*max expected spacing in pix */

View File

@ -26,22 +26,28 @@
#ifndef TESSERACT_CCMAIN_TESSERACTCLASS_H_ #ifndef TESSERACT_CCMAIN_TESSERACTCLASS_H_
#define TESSERACT_CCMAIN_TESSERACTCLASS_H_ #define TESSERACT_CCMAIN_TESSERACTCLASS_H_
#include "allheaders.h" #include <cstdint> // for int16_t, int32_t, uint16_t
#include "control.h" #include <cstdio> // for FILE
#include "debugpixa.h" #include "allheaders.h" // for pixDestroy, pixGetWidth, pixGetHe...
#include "devanagari_processing.h" #include "control.h" // for ACCEPTABLE_WERD_TYPE
#include "docqual.h" #include "debugpixa.h" // for DebugPixa
#include "genericvector.h" #include "devanagari_processing.h" // for ShiroRekhaSplitter
#include "ocrclass.h" #include "docqual.h" // for GARBAGE_LEVEL
#include "params.h" #include "genericvector.h" // for GenericVector, PointerVector
#include "textord.h" #include "host.h" // for BOOL8
#include "wordrec.h" #include "pageres.h" // for WERD_RES (ptr only), PAGE_RES (pt...
#ifdef DISABLED_LEGACY_ENGINE #include "params.h" // for BOOL_VAR_H, BoolParam, DoubleParam
#include "pageres.h" #include "points.h" // for FCOORD
#endif #include "publictypes.h" // for OcrEngineMode, PageSegMode, OEM_L...
#include "ratngs.h" // for ScriptPos, WERD_CHOICE (ptr only)
#include "strngs.h" // for STRING
#include "tessdatamanager.h" // for TessdataManager
#include "textord.h" // for Textord
#include "unichar.h" // for UNICHAR_ID
#include "wordrec.h" // for Wordrec
class BLOB_CHOICE_LIST_CLIST;
class BLOCK_LIST; class BLOCK_LIST;
class ETEXT_DESC;
struct OSResults; struct OSResults;
class PAGE_RES; class PAGE_RES;
class PAGE_RES_IT; class PAGE_RES_IT;
@ -169,7 +175,7 @@ class Tesseract : public Wordrec {
Tesseract(); Tesseract();
~Tesseract(); ~Tesseract();
// Return appropriate dictionary // Return appropriate dictionary
Dict& getDict() override; Dict& getDict() override;
// Clear as much used memory as possible without resetting the adaptive // Clear as much used memory as possible without resetting the adaptive

View File

@ -25,7 +25,6 @@
#include <cstring> // for memcpy #include <cstring> // for memcpy
#include "boxword.h" // for BoxWord #include "boxword.h" // for BoxWord
#include "genericvector.h" // for GenericVector #include "genericvector.h" // for GenericVector
#include "matrix.h" // for MATRIX_COORD, MATRIX (ptr only)
#include "params_training_featdef.h" // for ParamsTrainingBundle, ParamsTra... #include "params_training_featdef.h" // for ParamsTrainingBundle, ParamsTra...
#include "ratngs.h" // for BLOB_CHOICE_LIST (ptr only) #include "ratngs.h" // for BLOB_CHOICE_LIST (ptr only)
#include "rect.h" // for TBOX #include "rect.h" // for TBOX
@ -34,9 +33,11 @@
#include "unichar.h" // for UNICHAR_ID #include "unichar.h" // for UNICHAR_ID
class DENORM; class DENORM;
class MATRIX;
class UNICHARSET; class UNICHARSET;
class WERD_RES; class WERD_RES;
struct MATRIX_COORD;
struct TWERD; struct TWERD;
template <class R, class A1, class A2> class TessResultCallback2; template <class R, class A1, class A2> class TessResultCallback2;

View File

@ -18,13 +18,15 @@
**********************************************************************/ **********************************************************************/
#include "boxread.h" #include "boxread.h"
#include <cstring> #include <cstring> // for strchr, strcmp, strrchr
#include "errcode.h" // for ERRCODE, TESSEXIT
#include "fileerr.h" #include "fileerr.h" // for CANTOPENFILE
#include "rect.h" #include "genericvector.h" // for GenericVector
#include "strngs.h" #include "helpers.h" // for chomp_string
#include "tprintf.h" #include "rect.h" // for TBOX
#include "unichar.h" #include "strngs.h" // for STRING
#include "tprintf.h" // for tprintf
#include "unichar.h" // for UNICHAR
// Special char code used to identify multi-blob labels. // Special char code used to identify multi-blob labels.
static const char* kMultiBlobLabelCode = "WordStr"; static const char* kMultiBlobLabelCode = "WordStr";

View File

@ -17,12 +17,13 @@
* *
**********************************************************************/ **********************************************************************/
#ifndef POINTS_H #ifndef POINTS_H
#define POINTS_H #define POINTS_H
#include <stdio.h> #include <cmath> // for sqrt, atan2
#include <math.h> #include <cstdio>
#include "elst.h" #include "elst.h"
#include "platform.h" // for DLLSYM
class FCOORD; class FCOORD;

View File

@ -20,8 +20,9 @@
#ifndef POLYAPRX_H #ifndef POLYAPRX_H
#define POLYAPRX_H #define POLYAPRX_H
#include "blobs.h" class C_OUTLINE;
#include "coutln.h" struct EDGEPT;
struct TESSLINE;
// convert a chain-coded input to the old OUTLINE approximation // convert a chain-coded input to the old OUTLINE approximation
TESSLINE* ApproximateOutline(bool allow_detailed_fx, C_OUTLINE *c_outline); TESSLINE* ApproximateOutline(bool allow_detailed_fx, C_OUTLINE *c_outline);

View File

@ -1,8 +1,7 @@
/********************************************************************** /**********************************************************************
* File: quspline.cpp (Formerly qspline.c) * File: quspline.cpp (Formerly qspline.c)
* Description: Code for the QSPLINE class. * Description: Code for the QSPLINE class.
* Author: Ray Smith * Author: Ray Smith
* Created: Tue Oct 08 17:16:12 BST 1991
* *
* (C) Copyright 1991, Hewlett-Packard Ltd. * (C) Copyright 1991, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
@ -17,9 +16,12 @@
* *
**********************************************************************/ **********************************************************************/
#include "allheaders.h"
#include "quadlsq.h"
#include "quspline.h" #include "quspline.h"
#include "allheaders.h" // for pixRenderPolyline, pixGetDepth, pixGetHeight
#include "pix.h" // for L_CLEAR_PIXELS, L_SET_PIXELS, Pix (ptr only)
#include "points.h" // for ICOORD
#include "quadlsq.h" // for QLSQ
#include "quadratc.h" // for QUAD_COEFFS
// Include automatically generated configuration file if running autoconf. // Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H

View File

@ -20,11 +20,13 @@
#ifndef QUSPLINE_H #ifndef QUSPLINE_H
#define QUSPLINE_H #define QUSPLINE_H
#include "quadratc.h" #include <cstdint> // for int32_t
#include "serialis.h" #include "scrollview.h" // for ScrollView, ScrollView::Color
#include "rect.h"
class ICOORD;
class QUAD_COEFFS;
class ROW; class ROW;
class TBOX;
struct Pix; struct Pix;
class QSPLINE class QSPLINE

View File

@ -1,8 +1,8 @@
/********************************************************************** /**********************************************************************
* File: rect.h (Formerly box.h) * File: rect.h (Formerly box.h)
* Description: Bounding box class definition. * Description: Bounding box class definition.
* Author: Phil Cheatle * Author: Phil Cheatle
* Created: Wed Oct 16 15:18:45 BST 1991 * Created: Wed Oct 16 15:18:45 BST 1991
* *
* (C) Copyright 1991, Hewlett-Packard Ltd. * (C) Copyright 1991, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
@ -17,14 +17,20 @@
* *
**********************************************************************/ **********************************************************************/
#ifndef RECT_H #ifndef RECT_H
#define RECT_H #define RECT_H
#include <cmath> #include <algorithm> // for std::max, std::min
#include "points.h" #include <cmath> // for ceil, floor
#include "scrollview.h" #include <cstdint> // for INT16_MAX
#include "strngs.h" #include <cstdio> // for FILE
#include "tprintf.h" #include "ipoints.h" // for operator+=, operator-=, ICOORD::rotate
#include "platform.h" // for DLLSYM
#include "points.h" // for ICOORD, FCOORD
#include "scrollview.h" // for ScrollView, ScrollView::Color
#include "tprintf.h" // for tprintf
class STRING;
class DLLSYM TBOX { // bounding box class DLLSYM TBOX { // bounding box
public: public:

View File

@ -1,14 +1,10 @@
/* -*-C-*- /* -*-C-*-
******************************************************************************** ********************************************************************************
* *
* File: split.h (Formerly split.h) * File: split.h
* Description: * Description:
* Author: Mark Seaman, SW Productivity * Author: Mark Seaman, SW Productivity
* Created: Fri Oct 16 14:37:00 1987 * Status: Reusable Software Component
* Modified: Mon May 13 10:49:23 1991 (Mark Seaman) marks@hpgrlt
* Language: C
* Package: N/A
* Status: Reusable Software Component
* *
* (c) Copyright 1987, Hewlett-Packard Company. * (c) Copyright 1987, Hewlett-Packard Company.
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
@ -28,8 +24,12 @@
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
I n c l u d e s I n c l u d e s
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
#include "blobs.h"
#include "scrollview.h" #include "blobs.h" // for EDGEPT, TBLOB, TESSLINE
#include "params.h" // for BOOL_VAR_H, BoolParam
#include "rect.h" // for TBOX
class ScrollView;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
T y p e s T y p e s

View File

@ -17,14 +17,19 @@
* *
**********************************************************************/ **********************************************************************/
#include "stepblob.h"
#include "allheaders.h"
// Include automatically generated configuration file if running autoconf. // Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config_auto.h" #include "config_auto.h"
#endif #endif
#include "stepblob.h"
#include "allheaders.h" // for pixCreate, pixGetDepth
#include "genericvector.h" // for GenericVector
#include "host.h" // for TRUE, FALSE
#include "ipoints.h" // for operator+=
class DENORM;
// Max perimeter to width ratio for a baseline position above box bottom. // Max perimeter to width ratio for a baseline position above box bottom.
const double kMaxPerimeterWidthRatio = 8.0; const double kMaxPerimeterWidthRatio = 8.0;

View File

@ -20,11 +20,18 @@
#ifndef STEPBLOB_H #ifndef STEPBLOB_H
#define STEPBLOB_H #define STEPBLOB_H
#include "coutln.h" #include <cstdint> // for int32_t, int16_t
#include "rect.h" #include "coutln.h" // for C_OUTLINE_LIST, C_OUTLINE
#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK
#include "points.h" // for FCOORD, ICOORD (ptr only)
#include "rect.h" // for TBOX
#include "scrollview.h" // for ScrollView, ScrollView::Color
class C_BLOB; class C_BLOB;
class DENORM;
struct Pix; struct Pix;
ELISTIZEH(C_BLOB) ELISTIZEH(C_BLOB)
class C_BLOB:public ELIST_LINK class C_BLOB:public ELIST_LINK

View File

@ -15,10 +15,12 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
#ifndef TESSERACT_LSTM_STATIC_SHAPE_H_ #ifndef TESSERACT_LSTM_STATIC_SHAPE_H_
#define TESSERACT_LSTM_STATIC_SHAPE_H_ #define TESSERACT_LSTM_STATIC_SHAPE_H_
#include "tprintf.h" #include "serialis.h" // for TFile
#include "tprintf.h" // for tprintf
namespace tesseract { namespace tesseract {

View File

@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
#include "stridemap.h" #include "stridemap.h"
#include <cassert> // for assert
namespace tesseract { namespace tesseract {

View File

@ -21,22 +21,39 @@
#include "config_auto.h" #include "config_auto.h"
#endif #endif
#include <cfloat> // for FLT_MAX
#include "globaloc.h"
#include "blread.h"
#include "blobbox.h"
#include "ccstruct.h"
#include "edgblob.h"
#include "drawtord.h"
#include "makerow.h"
#include "wordseg.h"
#include "textord.h"
#include "tordmain.h" #include "tordmain.h"
#include <cfloat> // for FLT_MAX
#include <cmath> // for ceil, floor, M_PI
#include <cstdint> // for INT16_MAX, uint32_t, int32_t, int16_t
#include "allheaders.h" // for pixDestroy, pixGetHeight, boxCreate
#include "arrayaccess.h" // for GET_DATA_BYTE
#include "blobbox.h" // for BLOBNBOX_IT, BLOBNBOX, TO_BLOCK, TO_B...
#include "ccstruct.h" // for CCStruct, CCStruct::kXHeightFraction
#include "clst.h" // for CLISTIZE
#include "coutln.h" // for C_OUTLINE_IT, C_OUTLINE_LIST, C_OUTLINE
#include "drawtord.h" // for plot_box_list, to_win, create_to_win
#include "edgblob.h" // for extract_edges
#include "errcode.h" // for set_global_loc_code, ASSERT_HOST, LOC...
#include "genericvector.h" // for PointerVector, GenericVector
#include "makerow.h" // for textord_test_x, textord_test_y, texto...
#include "morph.h" // for L_BOUNDARY_BG
#include "ocrblock.h" // for BLOCK_IT, BLOCK, BLOCK_LIST (ptr only)
#include "ocrrow.h" // for ROW, ROW_IT, ROW_LIST, tweak_row_base...
#include "params.h" // for DoubleParam, BoolParam, IntParam
#include "pdblock.h" // for PDBLK
#include "points.h" // for FCOORD, ICOORD
#include "polyblk.h" // for POLY_BLOCK
#include "quadratc.h" // for QUAD_COEFFS
#include "quspline.h" // for QSPLINE, tweak_row_baseline
#include "rect.h" // for TBOX
#include "scrollview.h" // for ScrollView, ScrollView::WHITE
#include "statistc.h" // for STATS
#include "stepblob.h" // for C_BLOB_IT, C_BLOB, C_BLOB_LIST
#include "textord.h" // for Textord, WordWithBox, WordGrid, WordS...
#include "tprintf.h" // for tprintf
#include "werd.h" // for WERD_IT, WERD, WERD_LIST, W_DONT_CHOP
#include "allheaders.h" struct Box;
#undef EXTERN
#define EXTERN
#define MAX_NEAREST_DIST 600 //for block skew stats #define MAX_NEAREST_DIST 600 //for block skew stats

View File

@ -27,22 +27,30 @@
I n c l u d e s I n c l u d e s
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
#include <cmath>
#include "chopper.h" #include "chopper.h"
#include "blamer.h" // for BlamerBundle, IRR_CORRECT
#include "blobs.h" // for TPOINT, TBLOB, EDGEPT, TESSLINE, divisible_blob
#include "callcpp.h" // for Red
#include "dict.h" // for Dict
#include "host.h" // for FALSE, TRUE
#include "lm_pain_points.h" // for LMPainPoints
#include "lm_state.h" // for BestChoiceBundle
#include "matrix.h" // for MATRIX
#include "normalis.h" // for DENORM
#include "pageres.h" // for WERD_RES
#include "params.h" // for IntParam, BoolParam
#include "ratngs.h" // for BLOB_CHOICE (ptr only), BLOB_CHOICE_LIST (ptr ...
#include "rect.h" // for TBOX
#include "render.h" // for display_blob
#include "seam.h" // for SEAM
#include "split.h" // for remove_edgept
#include "stopper.h" // for DANGERR
#include "tprintf.h" // for tprintf
#include "wordrec.h" // for Wordrec, SegSearchPending (ptr only)
#include "associate.h" class CHAR_FRAGMENT;
#include "blobs.h"
#include "callcpp.h" template <typename T> class GenericVector;
#include "findseam.h"
#include "globals.h"
#include "render.h"
#include "pageres.h"
#include "seam.h"
#include "stopper.h"
#include "structures.h"
#include "unicharset.h"
#include "wordrec.h"
// Include automatically generated configuration file if running autoconf. // Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H

View File

@ -18,21 +18,31 @@
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
#include <cmath>
#include "language_model.h" #include "language_model.h"
#include <cassert> // for assert
#include <cmath> // for log2, pow
#include "blamer.h" // for BlamerBundle
#include "ccutil.h" // for CCUtil
#include "dawg.h" // for NO_EDGE, Dawg, Dawg::kPatternUn...
#include "errcode.h" // for ASSERT_HOST
#include "lm_state.h" // for ViterbiStateEntry, ViterbiState...
#include "matrix.h" // for MATRIX_COORD
#include "pageres.h" // for WERD_RES
#include "params.h" // for IntParam, BoolParam, DoubleParam
#include "params_training_featdef.h" // for ParamsTrainingHypothesis, PTRAI...
#include "tprintf.h" // for tprintf
#include "unichar.h" // for UNICHAR_ID, INVALID_UNICHAR_ID
#include "unicharset.h" // for UNICHARSET
#include "unicity_table.h" // for UnicityTable
#include "dawg.h" template <typename T> class GenericVector;
#include "intproto.h" template <typename T> class UnicityTable;
#include "helpers.h"
#include "lm_state.h"
#include "lm_pain_points.h"
#include "matrix.h"
#include "params.h"
#include "params_training_featdef.h"
namespace tesseract { namespace tesseract {
class LMPainPoints;
struct FontInfo;
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID) #if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID)
static inline double log2(double n) { static inline double log2(double n) {
return log(n) / log(2.0); return log(n) / log(2.0);

View File

@ -22,21 +22,30 @@
#ifndef TESSERACT_WORDREC_LANGUAGE_MODEL_H_ #ifndef TESSERACT_WORDREC_LANGUAGE_MODEL_H_
#define TESSERACT_WORDREC_LANGUAGE_MODEL_H_ #define TESSERACT_WORDREC_LANGUAGE_MODEL_H_
#include "associate.h" #include <cmath> // for exp
#include "dawg.h" #include "associate.h" // for AssociateStats (ptr only), AssociateUtils
#include "dict.h" #include "dawg.h" // for DawgPositionVector
#include "fontinfo.h" #include "dict.h" // for DawgArgs, Dict
#include "intproto.h" #include "lm_consistency.h" // for LMConsistencyInfo
#include "lm_consistency.h" #include "lm_state.h" // for ViterbiStateEntry, LanguageModelFlagsType
#include "lm_pain_points.h" #include "params.h" // for DoubleParam, double_VAR_H, IntParam, Boo...
#include "lm_state.h" #include "params_model.h" // for ParamsModel
#include "matrix.h" #include "ratngs.h" // for BLOB_CHOICE (ptr only), BLOB_CHOICE_LIST...
#include "params.h" #include "stopper.h" // for DANGERR
#include "pageres.h" #include "strngs.h" // for STRING
#include "params_model.h"
class UNICHARSET;
class WERD_RES;
struct BlamerBundle;
template <typename T> class UnicityTable;
namespace tesseract { namespace tesseract {
class LMPainPoints;
struct FontInfo;
// This class that contains the data structures and functions necessary // This class that contains the data structures and functions necessary
// to represent and use the knowledge about the language. // to represent and use the knowledge about the language.
class LanguageModel { class LanguageModel {

View File

@ -21,10 +21,11 @@
#ifndef TESSERACT_WORDREC_LM_CONSISTENCY_H_ #ifndef TESSERACT_WORDREC_LM_CONSISTENCY_H_
#define TESSERACT_WORDREC_LM_CONSISTENCY_H_ #define TESSERACT_WORDREC_LM_CONSISTENCY_H_
#include "dawg.h" #include <cstdint> // for INT16_MAX
#include "dict.h" #include "dawg.h" // for EDGE_REF, NO_EDGE
#include "host.h" #include "dict.h" // for XH_GOOD, XH_INCONSISTENT, XHeightConsi...
#include "ratngs.h"
class BLOB_CHOICE;
namespace tesseract { namespace tesseract {

View File

@ -23,13 +23,17 @@
#ifndef TESSERACT_WORDREC_PAIN_POINTS_H_ #ifndef TESSERACT_WORDREC_PAIN_POINTS_H_
#define TESSERACT_WORDREC_PAIN_POINTS_H_ #define TESSERACT_WORDREC_PAIN_POINTS_H_
#include "associate.h" #include "genericheap.h" // for GenericHeap
#include "dict.h" #include "matrix.h" // for MATRIX_COORD (ptr only), MatrixCoordPair
#include "genericheap.h" #include "stopper.h" // for DANGERR
#include "lm_state.h"
class WERD_RES;
namespace tesseract { namespace tesseract {
class Dict;
struct ViterbiStateEntry;
// Heap of pain points used for determining where to chop/join. // Heap of pain points used for determining where to chop/join.
using PainPointHeap = GenericHeap<MatrixCoordPair>; using PainPointHeap = GenericHeap<MatrixCoordPair>;

View File

@ -22,14 +22,16 @@
#ifndef TESSERACT_WORDREC_LANGUAGE_MODEL_DEFS_H_ #ifndef TESSERACT_WORDREC_LANGUAGE_MODEL_DEFS_H_
#define TESSERACT_WORDREC_LANGUAGE_MODEL_DEFS_H_ #define TESSERACT_WORDREC_LANGUAGE_MODEL_DEFS_H_
#include "associate.h" #include "associate.h" // for AssociateStats
#include "elst.h" #include "dawg.h" // for DawgPositionVector
#include "dawg.h" #include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK
#include "lm_consistency.h" #include "genericvector.h" // for PointerVector
#include "matrix.h" #include "lm_consistency.h" // for LMConsistencyInfo
#include "ratngs.h" #include "ratngs.h" // for BLOB_CHOICE, PermuterType
#include "stopper.h" #include "stopper.h" // for DANGERR
#include "strngs.h" #include "strngs.h" // for STRING
#include "unichar.h" // for UNICHAR_ID
#include "unicharset.h" // for UNICHARSET
namespace tesseract { namespace tesseract {

View File

@ -1,7 +1,7 @@
/* -*-C-*- /* -*-C-*-
******************************************************************************** ********************************************************************************
* *
* File: outlines.h (Formerly outlines.h) * File: outlines.h
* Description: Combinatorial Splitter * Description: Combinatorial Splitter
* Author: Mark Seaman, OCR Technology * Author: Mark Seaman, OCR Technology
* Created: Thu Jul 27 11:27:55 1989 * Created: Thu Jul 27 11:27:55 1989
@ -22,13 +22,14 @@
** limitations under the License. ** limitations under the License.
* *
*********************************************************************************/ *********************************************************************************/
#ifndef OUTLINES_H #ifndef OUTLINES_H
#define OUTLINES_H #define OUTLINES_H
#include "blobs.h" #include <cmath> // for abs
#include "chop.h" #include "blobs.h" // for TPOINT
#include "params.h" // for IntParam
#include <cmath> #include "wordrec.h" // for Wordrec
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
C o n s t a n t s C o n s t a n t s

View File

@ -20,12 +20,14 @@
#ifndef TESSERACT_WORDREC_PARAMS_MODEL_H_ #ifndef TESSERACT_WORDREC_PARAMS_MODEL_H_
#define TESSERACT_WORDREC_PARAMS_MODEL_H_ #define TESSERACT_WORDREC_PARAMS_MODEL_H_
#include "params_training_featdef.h" #include "genericvector.h" // for GenericVector
#include "ratngs.h" #include "params_training_featdef.h" // for PTRAIN_NUM_FEATURE_TYPES
#include "strngs.h" #include "strngs.h" // for STRING
namespace tesseract { namespace tesseract {
class TFile;
// Represents the learned weights for a given language. // Represents the learned weights for a given language.
class ParamsModel { class ParamsModel {
public: public:

View File

@ -1,7 +1,7 @@
/* -*-C-*- /* -*-C-*-
******************************************************************************** ********************************************************************************
* *
* File: plotedges.h (Formerly plotedges.h) * File: plotedges.h
* Description: Convert the various data type into line lists * Description: Convert the various data type into line lists
* Author: Mark Seaman, OCR Technology * Author: Mark Seaman, OCR Technology
* Created: Fri Jul 28 13:14:48 1989 * Created: Fri Jul 28 13:14:48 1989
@ -22,12 +22,16 @@
** limitations under the License. ** limitations under the License.
* *
*********************************************************************************/ *********************************************************************************/
#ifndef PLOTEDGES_H #ifndef PLOTEDGES_H
#define PLOTEDGES_H #define PLOTEDGES_H
#include "callcpp.h" #include "oldlist.h" // for LIST
#include "oldlist.h"
#include "blobs.h" class ScrollView;
struct EDGEPT;
struct TBLOB;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
V a r i a b l e s V a r i a b l e s

View File

@ -25,9 +25,14 @@
#ifndef RENDER_H #ifndef RENDER_H
#define RENDER_H #define RENDER_H
#include "host.h" #include "callcpp.h" // for C_COL
#include "callcpp.h" #include "params.h" // for BOOL_VAR_H, BoolParam
#include "blobs.h"
class ScrollView;
struct EDGEPT;
struct TBLOB;
struct TESSLINE;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
V a r i a b l e s V a r i a b l e s

View File

@ -17,16 +17,20 @@
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
#include "wordrec.h" #include <stdint.h> // for INT32_MAX
#include "blamer.h" // for BlamerBundle
#include "associate.h" #include "errcode.h" // for ASSERT_HOST
#include "language_model.h" #include "genericvector.h" // for GenericVector
#include "matrix.h" #include "lm_pain_points.h" // for LMPainPoints, LM_PPTYPE_SHAPE, LMPainPoi...
#include "params.h" #include "lm_state.h" // for BestChoiceBundle, ViterbiStateEntry
#include "lm_pain_points.h" #include "matrix.h" // for MATRIX_COORD, MATRIX
#include "ratngs.h" #include "pageres.h" // for WERD_RES
#include "params.h" // for BoolParam, IntParam, DoubleParam
#include <algorithm> #include "ratngs.h" // for BLOB_CHOICE_LIST, BLOB_CHOICE_IT
#include "strngs.h" // for STRING
#include "tesscallback.h" // for TessResultCallback2
#include "tprintf.h" // for tprintf
#include "wordrec.h" // for Wordrec, SegSearchPending (ptr only)
namespace tesseract { namespace tesseract {

View File

@ -4,11 +4,6 @@
* File: wordclass.cpp (Formerly wordclass.c) * File: wordclass.cpp (Formerly wordclass.c)
* Description: Word classifier * Description: Word classifier
* Author: Mark Seaman, OCR Technology * Author: Mark Seaman, OCR Technology
* Created: Tue Jan 30 14:03:25 1990
* Modified: Fri Jul 12 16:03:06 1991 (Mark Seaman) marks@hpgrlt
* Language: C
* Package: N/A
* Status: Experimental (Do Not Distribute)
* *
* (c) Copyright 1990, Hewlett-Packard Company. * (c) Copyright 1990, Hewlett-Packard Company.
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
@ -25,13 +20,16 @@
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
I N C L U D E S I N C L U D E S
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
#include <cassert>
#include <cstdio>
#include "associate.h" #include "blamer.h" // for blamer_bundle
#include "render.h" #include "callcpp.h" // for window_wait, C_COL
#include "callcpp.h" #include "params.h" // for BoolParam
#include "wordrec.h" #include "render.h" // for display_blob, blob_window, wordrec_blob_pause
#include "wordrec.h" // for Wordrec
class BLOB_CHOICE_LIST;
struct TBLOB;
// Include automatically generated configuration file if running autoconf. // Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H

View File

@ -19,24 +19,43 @@
#ifndef TESSERACT_WORDREC_WORDREC_H_ #ifndef TESSERACT_WORDREC_WORDREC_H_
#define TESSERACT_WORDREC_WORDREC_H_ #define TESSERACT_WORDREC_WORDREC_H_
// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif
#ifdef DISABLED_LEGACY_ENGINE #ifdef DISABLED_LEGACY_ENGINE
#include "classify.h" #include "config_auto.h"
#include "dict.h"
#include "ratngs.h"
#include "matrix.h"
#include "callcpp.h"
#include <memory> #include <cstdint> // for int16_t, int32_t
#include "callcpp.h" // for C_COL
#include "chop.h" // for PointHeap, MAX_NUM_POINTS
#include "classify.h" // for Classify
#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK
#include "findseam.h" // for SeamQueue, SeamPile
#include "genericvector.h" // for GenericVector
#include "oldlist.h" // for LIST
#include "params.h" // for INT_VAR_H, IntParam, BOOL_VAR_H, BoolP...
#include "points.h" // for ICOORD
#include "ratngs.h" // for BLOB_CHOICE_LIST (ptr only), BLOB_CHOI...
#include "seam.h" // for SEAM (ptr only), PRIORITY
#include "stopper.h" // for DANGERR
class EDGEPT_CLIST;
class MATRIX;
class STRING;
class TBOX;
class UNICHARSET;
class WERD_RES; class WERD_RES;
namespace tesseract { class LMPainPoints; }
namespace tesseract { class TessdataManager; }
namespace tesseract { struct BestChoiceBundle; }
struct BlamerBundle;
struct EDGEPT;
struct MATRIX_COORD;
struct SPLIT;
struct TBLOB;
struct TESSLINE;
struct TWERD;
namespace tesseract { namespace tesseract {
/* ccmain/tstruct.cpp */ /* ccmain/tstruct.cpp */