From a32d24fa65b4afbbd189188ff4c96bd23575a557 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 24 Jun 2018 16:13:23 +0200 Subject: [PATCH 1/2] Remove empty tessbox.h Signed-off-by: Stefan Weil --- src/api/baseapi.cpp | 1 - src/ccmain/Makefile.am | 2 +- src/ccmain/adaptions.cpp | 1 - src/ccmain/control.cpp | 1 - src/ccmain/fixspace.cpp | 31 +++++++++++++++---------------- src/ccmain/tessbox.cpp | 5 ++--- src/ccmain/tessbox.h | 28 ---------------------------- 7 files changed, 18 insertions(+), 51 deletions(-) delete mode 100644 src/ccmain/tessbox.h diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index a529e62b..f995271c 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -70,7 +70,6 @@ #include "globals.h" #include "edgblob.h" #include "equationdetect.h" -#include "tessbox.h" #include "makerow.h" #include "otsuthr.h" #include "osdetect.h" diff --git a/src/ccmain/Makefile.am b/src/ccmain/Makefile.am index 6f1348f5..518cc766 100644 --- a/src/ccmain/Makefile.am +++ b/src/ccmain/Makefile.am @@ -25,7 +25,7 @@ pkginclude_HEADERS = \ noinst_HEADERS = \ control.h docqual.h equationdetect.h fixspace.h mutableiterator.h \ output.h paragraphs.h paragraphs_internal.h osdetect.h paramsd.h pgedit.h \ - reject.h tessbox.h tessedit.h tesseractclass.h tessvars.h werdit.h + reject.h tessedit.h tesseractclass.h tessvars.h werdit.h noinst_LTLIBRARIES = libtesseract_main.la diff --git a/src/ccmain/adaptions.cpp b/src/ccmain/adaptions.cpp index 437573be..924097f0 100644 --- a/src/ccmain/adaptions.cpp +++ b/src/ccmain/adaptions.cpp @@ -20,7 +20,6 @@ #include #include -#include "tessbox.h" #include "tessvars.h" #include "memry.h" #include "reject.h" diff --git a/src/ccmain/control.cpp b/src/ccmain/control.cpp index 4317be3d..1fed1eea 100644 --- a/src/ccmain/control.cpp +++ b/src/ccmain/control.cpp @@ -43,7 +43,6 @@ #include "pgedit.h" #include "reject.h" #include "sorthelper.h" -#include "tessbox.h" #include "tesseractclass.h" #include "tessvars.h" #include "werdit.h" diff --git a/src/ccmain/fixspace.cpp b/src/ccmain/fixspace.cpp index 8a60e393..482664a8 100644 --- a/src/ccmain/fixspace.cpp +++ b/src/ccmain/fixspace.cpp @@ -3,21 +3,21 @@ * Description: Implements a pass over the page res, exploring the alternative * spacing possibilities, trying to use context to improve the * word spacing -* Author: Phil Cheatle -* Created: Thu Oct 21 11:38:43 BST 1993 -* -* (C) Copyright 1993, Hewlett-Packard Ltd. -** 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. -* -**********************************************************************/ + * Author: Phil Cheatle + * Created: Thu Oct 21 11:38:43 BST 1993 + * + * (C) Copyright 1993, Hewlett-Packard Ltd. + ** 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. + * + **********************************************************************/ #include #include "reject.h" @@ -26,7 +26,6 @@ #include "fixspace.h" #include "genblob.h" #include "tessvars.h" -#include "tessbox.h" #include "globals.h" #include "tesseractclass.h" diff --git a/src/ccmain/tessbox.cpp b/src/ccmain/tessbox.cpp index 64b3eb68..45b049ce 100644 --- a/src/ccmain/tessbox.cpp +++ b/src/ccmain/tessbox.cpp @@ -1,8 +1,8 @@ /********************************************************************** * File: tessbox.cpp (Formerly tessbox.c) * Description: Black boxed Tess for developing a resaljet. - * Author: Ray Smith - * Created: Thu Apr 23 11:03:36 BST 1992 + * Author: Ray Smith + * Created: Thu Apr 23 11:03:36 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,6 @@ **********************************************************************/ #include "mfoutline.h" -#include "tessbox.h" #include "tesseractclass.h" #define EXTERN diff --git a/src/ccmain/tessbox.h b/src/ccmain/tessbox.h deleted file mode 100644 index d655a204..00000000 --- a/src/ccmain/tessbox.h +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * File: tessbox.h (Formerly tessbox.h) - * Description: Black boxed Tess for developing a resaljet. - * Author: Ray Smith - * Created: Thu Apr 23 11:03:36 BST 1992 - * - * (C) Copyright 1992, Hewlett-Packard Ltd. - ** 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. - * - **********************************************************************/ - -#ifndef TESSBOX_H -#define TESSBOX_H - -#include "ratngs.h" -#include "tesseractclass.h" - -// TODO(ocr-team): Delete this along with other empty header files. - -#endif From 7768f9b33682d01b741cc6ac5237f2930d185f86 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 24 Jun 2018 16:14:28 +0200 Subject: [PATCH 2/2] Clean more include files and include statements The changes are based on an analysis done with include-what-you-use. Signed-off-by: Stefan Weil --- src/ccmain/control.h | 14 ++---- src/ccmain/docqual.h | 15 ++++-- src/ccmain/equationdetect.h | 14 ++---- src/ccmain/fixspace.h | 43 ++++++++-------- src/ccmain/osdetect.h | 10 ++-- src/ccmain/output.h | 14 +++--- src/ccmain/paragraphs.cpp | 47 +++++++++++------- src/ccmain/paragraphs.h | 13 ++--- src/ccmain/paramsd.cpp | 28 +++++------ src/ccmain/paramsd.h | 14 ++++-- src/ccmain/pgedit.h | 21 ++++---- src/ccmain/reject.h | 15 +++--- src/ccmain/resultiterator.h | 9 ++-- src/ccmain/tessedit.h | 11 ++--- src/ccmain/werdit.cpp | 8 ++- src/ccmain/werdit.h | 8 +-- src/ccstruct/blamer.h | 27 ++++++++--- src/ccstruct/blobbox.cpp | 2 +- src/ccstruct/blobbox.h | 36 ++++++++++---- src/ccstruct/blobs.h | 17 +++++-- src/ccstruct/blread.cpp | 7 +-- src/ccstruct/blread.h | 15 +++--- src/ccstruct/boxread.h | 13 ++--- src/ccstruct/boxword.h | 14 +++--- src/ccstruct/ccstruct.h | 4 +- src/ccstruct/coutln.h | 10 ++-- src/ccstruct/linlsq.h | 10 ++-- src/ccstruct/matrix.h | 19 +++++--- src/ccstruct/normalis.h | 19 ++++---- src/ccstruct/ocrrow.h | 16 +++--- src/ccstruct/pageres.h | 53 +++++++++++++------- src/classify/adaptmatch.cpp | 89 +++++++++++++++++++--------------- unittest/intsimdmatrix_test.cc | 1 + 33 files changed, 366 insertions(+), 270 deletions(-) diff --git a/src/ccmain/control.h b/src/ccmain/control.h index 2f76a47c..cd57ddba 100644 --- a/src/ccmain/control.h +++ b/src/ccmain/control.h @@ -1,8 +1,8 @@ /********************************************************************** * File: control.h (Formerly control.h) * Description: Module-independent matcher controller. - * Author: Ray Smith - * Created: Thu Apr 23 11:09:58 BST 1992 + * Author: Ray Smith + * Created: Thu Apr 23 11:09:58 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,14 +22,8 @@ * Module-independent matcher controller. */ -#ifndef CONTROL_H -#define CONTROL_H - -#include "params.h" -#include "ocrblock.h" -#include "ratngs.h" -#include "statistc.h" -#include "pageres.h" +#ifndef CONTROL_H +#define CONTROL_H enum ACCEPTABLE_WERD_TYPE { diff --git a/src/ccmain/docqual.h b/src/ccmain/docqual.h index dc032c5e..22f40e21 100644 --- a/src/ccmain/docqual.h +++ b/src/ccmain/docqual.h @@ -1,8 +1,8 @@ /****************************************************************** * File: docqual.h (Formerly docqual.h) * Description: Document Quality Metrics - * Author: Phil Cheatle - * Created: Mon May 9 11:27:28 BST 1994 + * Author: Phil Cheatle + * Created: Mon May 9 11:27:28 BST 1994 * * (C) Copyright 1994, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,10 +17,14 @@ * **********************************************************************/ -#ifndef DOCQUAL_H -#define DOCQUAL_H +#ifndef DOCQUAL_H +#define DOCQUAL_H -#include "control.h" +#include // for int16_t + +class PAGE_RES_IT; +class ROW; +class WERD_RES; enum GARBAGE_LEVEL { @@ -32,4 +36,5 @@ enum GARBAGE_LEVEL int16_t word_blob_quality(WERD_RES *word, ROW *row); void reject_whole_page(PAGE_RES_IT &page_res_it); + #endif diff --git a/src/ccmain/equationdetect.h b/src/ccmain/equationdetect.h index fedb70b0..528f255b 100644 --- a/src/ccmain/equationdetect.h +++ b/src/ccmain/equationdetect.h @@ -20,16 +20,12 @@ #ifndef TESSERACT_CCMAIN_EQUATIONDETECT_H_ #define TESSERACT_CCMAIN_EQUATIONDETECT_H_ -#include "blobbox.h" -#include "equationdetectbase.h" -#include "genericvector.h" -#include "tesseractclass.h" -#include "unichar.h" +#include "blobbox.h" // for BLOBNBOX (ptr only), BlobSpecialText... +#include "equationdetectbase.h" // for EquationDetectBase +#include "genericvector.h" // for GenericVector +#include "tesseractclass.h" // for Tesseract +#include "unichar.h" // for UNICHAR_ID -class BLOBNBOX; -class BLOB_CHOICE; -class BLOB_CHOICE_LIST; -class TO_BLOCK_LIST; class TBOX; class UNICHARSET; diff --git a/src/ccmain/fixspace.h b/src/ccmain/fixspace.h index 5233bda2..b60fb0e7 100644 --- a/src/ccmain/fixspace.h +++ b/src/ccmain/fixspace.h @@ -1,31 +1,32 @@ /****************************************************************** * File: fixspace.h (Formerly fixspace.h) * Description: Implements a pass over the page res, exploring the alternative - * spacing possibilities, trying to use context to improve the - word spacing -* Author: Phil Cheatle -* Created: Thu Oct 21 11:38:43 BST 1993 -* -* (C) Copyright 1993, Hewlett-Packard Ltd. -** 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. -* -**********************************************************************/ + * spacing possibilities, trying to use context to improve the + * word spacing + * Author: Phil Cheatle + * Created: Thu Oct 21 11:38:43 BST 1993 + * + * (C) Copyright 1993, Hewlett-Packard Ltd. + ** 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. + * + **********************************************************************/ -#ifndef FIXSPACE_H -#define FIXSPACE_H +#ifndef FIXSPACE_H +#define FIXSPACE_H -#include "pageres.h" -#include "params.h" +class WERD_RES; +class WERD_RES_LIST; void initialise_search(WERD_RES_LIST &src_list, WERD_RES_LIST &new_list); void transform_to_next_perm(WERD_RES_LIST &words); void fixspace_dbg(WERD_RES *word); + #endif diff --git a/src/ccmain/osdetect.h b/src/ccmain/osdetect.h index 52b00968..c0864c40 100644 --- a/src/ccmain/osdetect.h +++ b/src/ccmain/osdetect.h @@ -20,13 +20,15 @@ #ifndef TESSERACT_CCMAIN_OSDETECT_H_ #define TESSERACT_CCMAIN_OSDETECT_H_ -#include "strngs.h" -#include "unicharset.h" +#include "platform.h" // for TESS_API -class TO_BLOCK_LIST; class BLOBNBOX; -class BLOB_CHOICE_LIST; class BLOBNBOX_CLIST; +class BLOB_CHOICE_LIST; +class STRING; +class TO_BLOCK_LIST; +class UNICHARSET; +template class GenericVector; namespace tesseract { class Tesseract; diff --git a/src/ccmain/output.h b/src/ccmain/output.h index 7f297c93..7afc80b1 100644 --- a/src/ccmain/output.h +++ b/src/ccmain/output.h @@ -1,8 +1,8 @@ /****************************************************************** * File: output.h (Formerly output.h) * Description: Output pass - * Author: Phil Cheatle - * Created: Thu Aug 4 10:56:08 BST 1994 + * Author: Phil Cheatle + * Created: Thu Aug 4 10:56:08 BST 1994 * * (C) Copyright 1994, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,12 +17,11 @@ * **********************************************************************/ -#ifndef OUTPUT_H -#define OUTPUT_H +#ifndef OUTPUT_H +#define OUTPUT_H -#include "params.h" -//#include "epapconv.h" -#include "pageres.h" +class BLOCK; +class WERD; /** test line ends */ char determine_newline_type(WERD *word, ///< word to do @@ -30,4 +29,5 @@ char determine_newline_type(WERD *word, ///< word to do WERD *next_word, ///< next word BLOCK *next_block ///< block of next word ); + #endif diff --git a/src/ccmain/paragraphs.cpp b/src/ccmain/paragraphs.cpp index 4889e57c..a204c6c8 100644 --- a/src/ccmain/paragraphs.cpp +++ b/src/ccmain/paragraphs.cpp @@ -17,25 +17,36 @@ * **********************************************************************/ -#include -#include -#include // std::unique_ptr - -#include "genericvector.h" -#include "helpers.h" -#include "mutableiterator.h" -#include "ocrpara.h" -#include "pageres.h" #include "paragraphs.h" -#include "paragraphs_internal.h" -#include "publictypes.h" -#include "ratngs.h" -#include "rect.h" -#include "statistc.h" -#include "strngs.h" -#include "tprintf.h" -#include "unicharset.h" -#include "unicodes.h" +#include // for isspace +#include // for abs +#include // for snprintf +#include // for abs +#include // for strchr, strlen +#include // for max +#include // for unique_ptr +#include "genericvector.h" // for GenericVector, GenericVectorEqEq +#include "helpers.h" // for UpdateRange, ClipToRange +#include "host.h" // for NearlyEqual +#include "mutableiterator.h" // for MutableIterator +#include "ocrblock.h" // for BLOCK +#include "ocrpara.h" // for ParagraphModel, PARA, PARA_IT, PARA... +#include "ocrrow.h" // for ROW +#include "pageiterator.h" // for PageIterator +#include "pageres.h" // for PAGE_RES_IT, WERD_RES, ROW_RES, BLO... +#include "paragraphs_internal.h" // for RowScratchRegisters, SetOfModels +#include "pdblock.h" // for PDBLK +#include "polyblk.h" // for POLY_BLOCK +#include "publictypes.h" // for JUSTIFICATION_LEFT, JUSTIFICATION_R... +#include "ratngs.h" // for WERD_CHOICE +#include "rect.h" // for TBOX +#include "statistc.h" // for STATS +#include "strngs.h" // for STRING +#include "tprintf.h" // for tprintf +#include "unichar.h" // for UNICHAR, UNICHAR_ID +#include "unicharset.h" // for UNICHARSET +#include "unicodes.h" // for kPDF, kRLE +#include "werd.h" // for WERD, W_REP_CHAR namespace tesseract { diff --git a/src/ccmain/paragraphs.h b/src/ccmain/paragraphs.h index e92ff3b1..4a4f6f51 100644 --- a/src/ccmain/paragraphs.h +++ b/src/ccmain/paragraphs.h @@ -20,14 +20,15 @@ #ifndef TESSERACT_CCMAIN_PARAGRAPHS_H_ #define TESSERACT_CCMAIN_PARAGRAPHS_H_ -#include "rect.h" -#include "ocrpara.h" -#include "genericvector.h" -#include "strngs.h" +#include "rect.h" // for TBOX +#include "strngs.h" // for STRING +class PARA_LIST; +class ParagraphModel; -class WERD; -class UNICHARSET; +struct PARA; + +template class GenericVector; namespace tesseract { diff --git a/src/ccmain/paramsd.cpp b/src/ccmain/paramsd.cpp index 2d8037f8..d554e4e6 100644 --- a/src/ccmain/paramsd.cpp +++ b/src/ccmain/paramsd.cpp @@ -19,14 +19,6 @@ // // The parameters editor is used to edit all the parameters used within // tesseract from the ui. -#ifdef _WIN32 -#else -#include -#include -#endif - -#include -#include // Include automatically generated configuration file if running autoconf. #ifdef HAVE_CONFIG_H @@ -34,13 +26,19 @@ #endif #ifndef GRAPHICS_DISABLED + #include "paramsd.h" - - -#include "params.h" -#include "scrollview.h" -#include "svmnode.h" - +#include // for fclose, fopen, fprintf, sprintf, FILE +#include // for atoi, strtod +#include // for strcmp, strcspn, strlen, strncpy +#include // for map, _Rb_tree_iterator, map<>::iterator +#include // for unique_ptr +#include // for pair +#include "genericvector.h" // for GenericVector +#include "params.h" // for ParamsVectors, StringParam, BoolParam +#include "scrollview.h" // for SVEvent, ScrollView, SVET_POPUP +#include "svmnode.h" // for SVMenuNode +#include "tesseractclass.h" // for Tesseract #define VARDIR "configs/" /*parameters files */ #define MAX_ITEMS_IN_SUBMENU 30 @@ -354,4 +352,4 @@ void ParamsEditor::WriteParams(char *filename, } fclose(fp); } -#endif +#endif // GRAPHICS_DISABLED diff --git a/src/ccmain/paramsd.h b/src/ccmain/paramsd.h index 2f21d145..c913ca9f 100644 --- a/src/ccmain/paramsd.h +++ b/src/ccmain/paramsd.h @@ -24,12 +24,20 @@ #ifndef GRAPHICS_DISABLED -#include "elst.h" -#include "params.h" -#include "tesseractclass.h" +#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK +#include "scrollview.h" // for ScrollView (ptr only), SVEvent (ptr only) +#include "strngs.h" // for STRING class SVMenuNode; +namespace tesseract { + class BoolParam; + class DoubleParam; + class IntParam; + class StringParam; + class Tesseract; +} + // A list of all possible parameter types used. enum ParamType { VT_INTEGER, diff --git a/src/ccmain/pgedit.h b/src/ccmain/pgedit.h index e9fc6936..987eebe9 100644 --- a/src/ccmain/pgedit.h +++ b/src/ccmain/pgedit.h @@ -17,19 +17,18 @@ // /////////////////////////////////////////////////////////////////////// -#ifndef PGEDIT_H -#define PGEDIT_H +#ifndef PGEDIT_H +#define PGEDIT_H -#include "ocrblock.h" -#include "ocrrow.h" -#include "werd.h" -#include "rect.h" -#include "params.h" -#include "tesseractclass.h" +#include "params.h" // for INT_VAR_H, IntParam, STRING_VAR_H, StringParam +#include "scrollview.h" // for SVEvent (ptr only), SVEventHandler, ScrollView -class ScrollView; -class SVMenuNode; -struct SVEvent; +class BLOCK_LIST; +class PAGE_RES; + +namespace tesseract { + class Tesseract; +} // A small event handler class to process incoming events to // this window. diff --git a/src/ccmain/reject.h b/src/ccmain/reject.h index a4ccd496..ba3fef38 100644 --- a/src/ccmain/reject.h +++ b/src/ccmain/reject.h @@ -1,8 +1,8 @@ /********************************************************************** - * File: reject.h (Formerly reject.h) + * File: reject.h * Description: Rejection functions used in tessedit - * Author: Phil Cheatle - * Created: Wed Sep 23 16:50:21 BST 1992 + * Author: Phil Cheatle + * Created: Wed Sep 23 16:50:21 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,11 +17,11 @@ * **********************************************************************/ -#ifndef REJECT_H -#define REJECT_H +#ifndef REJECT_H +#define REJECT_H -#include "params.h" -#include "pageres.h" +class WERD_CHOICE; +class WERD_RES; void reject_blanks(WERD_RES *word); void reject_poor_matches(WERD_RES *word); @@ -31,4 +31,5 @@ void dont_allow_1Il(WERD_RES *word); void flip_hyphens(WERD_RES *word); void flip_0O(WERD_RES *word); bool non_0_digit(const char* str, int length); + #endif diff --git a/src/ccmain/resultiterator.h b/src/ccmain/resultiterator.h index f3d0e988..7bd48368 100644 --- a/src/ccmain/resultiterator.h +++ b/src/ccmain/resultiterator.h @@ -22,13 +22,14 @@ #ifndef TESSERACT_CCMAIN_RESULT_ITERATOR_H_ #define TESSERACT_CCMAIN_RESULT_ITERATOR_H_ -#include "platform.h" -#include "ltrresultiterator.h" +#include "ltrresultiterator.h" // for LTRResultIterator +#include "platform.h" // for TESS_API, TESS_LOCAL +#include "publictypes.h" // for PageIteratorLevel +#include "unichar.h" // for StrongScriptDirection template class GenericVector; template class GenericVectorEqEq; -class BLOB_CHOICE_IT; -class WERD_RES; + class STRING; namespace tesseract { diff --git a/src/ccmain/tessedit.h b/src/ccmain/tessedit.h index 5510e195..750056b7 100644 --- a/src/ccmain/tessedit.h +++ b/src/ccmain/tessedit.h @@ -1,8 +1,8 @@ /********************************************************************** * File: tessedit.h (Formerly tessedit.h) * Description: Main program for merge of tess and editor. - * Author: Ray Smith - * Created: Tue Jan 07 15:21:46 GMT 1992 + * Author: Ray Smith + * Created: Tue Jan 07 15:21:46 GMT 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,11 +17,10 @@ * **********************************************************************/ -#ifndef TESSEDIT_H -#define TESSEDIT_H +#ifndef TESSEDIT_H +#define TESSEDIT_H -#include "blobs.h" -#include "pgedit.h" +class ETEXT_DESC; //progress monitor extern ETEXT_DESC *global_monitor; diff --git a/src/ccmain/werdit.cpp b/src/ccmain/werdit.cpp index 274ec0b4..45bb71cb 100644 --- a/src/ccmain/werdit.cpp +++ b/src/ccmain/werdit.cpp @@ -1,8 +1,8 @@ /********************************************************************** * File: werdit.cpp (Formerly wordit.c) * Description: An iterator for passing over all the words in a document. - * Author: Ray Smith - * Created: Mon Apr 27 08:51:22 BST 1992 + * Author: Ray Smith + * Created: Mon Apr 27 08:51:22 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,10 @@ **********************************************************************/ #include "werdit.h" +#include "errcode.h" // for ASSERT_HOST +#include "pageres.h" // for PAGE_RES_IT, PAGE_RES (ptr only), WERD_RES +#include "stepblob.h" // for C_BLOB_IT, C_BLOB, C_BLOB_LIST +#include "werd.h" // for WERD /********************************************************************** * make_pseudo_word diff --git a/src/ccmain/werdit.h b/src/ccmain/werdit.h index 4366dbb0..66caaef5 100644 --- a/src/ccmain/werdit.h +++ b/src/ccmain/werdit.h @@ -17,10 +17,12 @@ * **********************************************************************/ -#ifndef WERDIT_H -#define WERDIT_H +#ifndef WERDIT_H +#define WERDIT_H -#include "pageres.h" +#include "rect.h" // for TBOX +class PAGE_RES; +class PAGE_RES_IT; PAGE_RES_IT* make_pseudo_word(PAGE_RES* page_res, const TBOX& selection_box); diff --git a/src/ccstruct/blamer.h b/src/ccstruct/blamer.h index f7d13d68..2a5059c5 100644 --- a/src/ccstruct/blamer.h +++ b/src/ccstruct/blamer.h @@ -21,14 +21,25 @@ #ifndef TESSERACT_CCSTRUCT_BLAMER_H_ #define TESSERACT_CCSTRUCT_BLAMER_H_ -#include -#include "boxword.h" -#include "genericvector.h" -#include "matrix.h" -#include "params_training_featdef.h" -#include "ratngs.h" -#include "strngs.h" -#include "tesscallback.h" +#include // for int16_t +#include // for memcpy +#include "boxword.h" // for BoxWord +#include "genericvector.h" // for GenericVector +#include "matrix.h" // for MATRIX_COORD, MATRIX (ptr only) +#include "params_training_featdef.h" // for ParamsTrainingBundle, ParamsTra... +#include "ratngs.h" // for BLOB_CHOICE_LIST (ptr only) +#include "rect.h" // for TBOX +#include "strngs.h" // for STRING +#include "tprintf.h" // for tprintf +#include "unichar.h" // for UNICHAR_ID + +class DENORM; +class UNICHARSET; +class WERD_RES; + +struct TWERD; + +template class TessResultCallback2; static const int16_t kBlamerBoxTolerance = 5; diff --git a/src/ccstruct/blobbox.cpp b/src/ccstruct/blobbox.cpp index 5228262b..69596e55 100644 --- a/src/ccstruct/blobbox.cpp +++ b/src/ccstruct/blobbox.cpp @@ -23,8 +23,8 @@ #endif #include "blobbox.h" -#include // for INT32_MAX, INT16_MAX #include // for max, min +#include // for INT32_MAX, INT16_MAX #include "allheaders.h" // for pixGetHeight, pixGetPixel #include "blobs.h" // for TPOINT #include "coutln.h" // for C_OUTLINE_IT, C_OUTLINE, C_OUTLINE_LIST diff --git a/src/ccstruct/blobbox.h b/src/ccstruct/blobbox.h index 76401889..03c53f62 100644 --- a/src/ccstruct/blobbox.h +++ b/src/ccstruct/blobbox.h @@ -1,8 +1,8 @@ /********************************************************************** * File: blobbox.h (Formerly blobnbox.h) * Description: Code for the textord blob class. - * Author: Ray Smith - * Created: Thu Jul 30 09:08:51 BST 1992 + * Author: Ray Smith + * Created: Thu Jul 30 09:08:51 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,14 +17,30 @@ * **********************************************************************/ -#ifndef BLOBBOX_H -#define BLOBBOX_H +#ifndef BLOBBOX_H +#define BLOBBOX_H -#include "clst.h" -#include "elst2.h" -#include "werd.h" -#include "ocrblock.h" -#include "statistc.h" +#include // for PRId32 +#include // for sqrt +#include // for int16_t, int32_t +#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK +#include "elst2.h" // for ELIST2_ITERATOR, ELIST2IZEH, ELIST2_LINK +#include "errcode.h" // for ASSERT_HOST +#include "ocrblock.h" // for BLOCK +#include "params.h" // for DoubleParam, double_VAR_H +#include "pdblock.h" // for PDBLK +#include "points.h" // for FCOORD, ICOORD, ICOORDELT_LIST +#include "quspline.h" // for QSPLINE +#include "rect.h" // for TBOX +#include "scrollview.h" // for ScrollView, ScrollView::Color +#include "statistc.h" // for STATS +#include "stepblob.h" // for C_BLOB +#include "tprintf.h" // for tprintf +#include "werd.h" // for WERD_LIST + +class C_OUTLINE; + +struct Pix; enum PITCH_TYPE { @@ -476,7 +492,7 @@ class BLOBNBOX:public ELIST_LINK right_rule_ = 0; left_crossing_rule_ = 0; right_crossing_rule_ = 0; - if (area_stroke_width_ == 0.0f && area > 0 && cblob() != nullptr + if (area_stroke_width_ == 0.0f && area > 0 && cblob() != nullptr && cblob()->perimeter()!=0) area_stroke_width_ = 2.0f * area / cblob()->perimeter(); owner_ = nullptr; diff --git a/src/ccstruct/blobs.h b/src/ccstruct/blobs.h index 26101f33..de34b23e 100644 --- a/src/ccstruct/blobs.h +++ b/src/ccstruct/blobs.h @@ -29,11 +29,16 @@ /*---------------------------------------------------------------------- I n c l u d e s ----------------------------------------------------------------------*/ -#include "clst.h" -#include "normalis.h" -#include "publictypes.h" -#include "rect.h" -#include "vecfuncs.h" +#include // for int16_t +#include // for memcpy, memset +#include "clst.h" // for CLIST_ITERATOR, CLISTIZEH +#include "genericvector.h" // for GenericVector +#include "normalis.h" // for DENORM +#include "points.h" // for FCOORD, ICOORD +#include "publictypes.h" // for OcrEngineMode +#include "rect.h" // for TBOX +#include "scrollview.h" // for ScrollView, ScrollView::Color +#include "vecfuncs.h" // for CROSS class BLOCK; class C_BLOB; @@ -42,6 +47,8 @@ class LLSQ; class ROW; class WERD; +struct Pix; + /*---------------------------------------------------------------------- T y p e s ----------------------------------------------------------------------*/ diff --git a/src/ccstruct/blread.cpp b/src/ccstruct/blread.cpp index 9d3291ca..4b7012b0 100644 --- a/src/ccstruct/blread.cpp +++ b/src/ccstruct/blread.cpp @@ -17,10 +17,11 @@ * **********************************************************************/ -#include -#include "scanutils.h" -#include "fileerr.h" #include "blread.h" +#include // for fclose, fopen, FILE +#include "host.h" // for TRUE +#include "ocrblock.h" // for BLOCK_IT, BLOCK, BLOCK_LIST (ptr only) +#include "scanutils.h" // for tfscanf #define UNLV_EXT ".uzn" // unlv zone file diff --git a/src/ccstruct/blread.h b/src/ccstruct/blread.h index de943ce3..210c3010 100644 --- a/src/ccstruct/blread.h +++ b/src/ccstruct/blread.h @@ -1,8 +1,8 @@ /********************************************************************** * File: blread.h (Formerly pdread.h) * Description: Friend function of BLOCK to read the uscan pd file. - * Author: Ray Smith - * Created: Mon Mar 18 14:39:00 GMT 1991 + * Author: Ray Smith + * Created: Mon Mar 18 14:39:00 GMT 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,11 +17,13 @@ * **********************************************************************/ -#ifndef BLREAD_H -#define BLREAD_H +#ifndef BLREAD_H +#define BLREAD_H -#include "params.h" -#include "ocrblock.h" +#include // for int32_t +#include "strngs.h" // for STRING + +class BLOCK_LIST; bool read_unlv_file( //print list of sides STRING name, //basename of file @@ -30,4 +32,5 @@ bool read_unlv_file( //print list of sides BLOCK_LIST *blocks //output list ); void FullPageBlock(int width, int height, BLOCK_LIST *blocks); + #endif diff --git a/src/ccstruct/boxread.h b/src/ccstruct/boxread.h index 3473f653..07295fd6 100644 --- a/src/ccstruct/boxread.h +++ b/src/ccstruct/boxread.h @@ -1,8 +1,8 @@ /********************************************************************** * File: boxread.h * Description: Read data from a box file. - * Author: Ray Smith - * Created: Fri Aug 24 17:47:23 PDT 2007 + * Author: Ray Smith + * Created: Fri Aug 24 17:47:23 PDT 2007 * * (C) Copyright 2007, Google Inc. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,13 +20,14 @@ #ifndef TESSERACT_CCUTIL_BOXREAD_H_ #define TESSERACT_CCUTIL_BOXREAD_H_ -#include -#include "genericvector.h" -#include "strngs.h" +#include // for FILE +#include "strngs.h" // for STRING -class STRING; class TBOX; +template class GenericVector; +template class GenericVector; + // Size of buffer used to read a line from a box file. const int kBoxReadBufSize = 1024; diff --git a/src/ccstruct/boxword.h b/src/ccstruct/boxword.h index 04ecdc0d..a1e6352c 100644 --- a/src/ccstruct/boxword.h +++ b/src/ccstruct/boxword.h @@ -20,17 +20,15 @@ #ifndef TESSERACT_CSTRUCT_BOXWORD_H_ #define TESSERACT_CSTRUCT_BOXWORD_H_ -#include "genericvector.h" -#include "rect.h" -#include "unichar.h" +#include "genericvector.h" // for GenericVector +#include "rect.h" // for TBOX class BLOCK; -class DENORM; -struct TWERD; -class UNICHARSET; class WERD; -class WERD_CHOICE; -class WERD_RES; + +struct TWERD; + +template class TessCallback1; namespace tesseract { diff --git a/src/ccstruct/ccstruct.h b/src/ccstruct/ccstruct.h index 1f860cdc..dfdf77bf 100644 --- a/src/ccstruct/ccstruct.h +++ b/src/ccstruct/ccstruct.h @@ -19,7 +19,7 @@ #ifndef TESSERACT_CCSTRUCT_CCSTRUCT_H_ #define TESSERACT_CCSTRUCT_CCSTRUCT_H_ -#include "cutil.h" +#include "cutil_class.h" // for CUtil namespace tesseract { class CCStruct : public CUtil { @@ -36,8 +36,6 @@ class CCStruct : public CUtil { // Derived value giving the x-height as a fraction of cap-height. static const double kXHeightCapRatio; // = XHeight/(XHeight + Ascender). }; - -class Tesseract; } // namespace tesseract #endif // TESSERACT_CCSTRUCT_CCSTRUCT_H_ diff --git a/src/ccstruct/coutln.h b/src/ccstruct/coutln.h index 5032e514..88a08918 100644 --- a/src/ccstruct/coutln.h +++ b/src/ccstruct/coutln.h @@ -1,8 +1,8 @@ /********************************************************************** - * File: coutln.h (Formerly: - *coutline.c) Description: Code for the C_OUTLINE class. Author: - *Ray Smith - * Created: Mon Oct 07 16:01:57 BST 1991 + * File: coutln.h + * Description: Code for the C_OUTLINE class. + * Author: Ray Smith + * Created: Mon Oct 07 16:01:57 BST 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,9 +32,7 @@ #include "scrollview.h" // for ScrollView, ScrollView::Color class CRACKEDGE; -class C_OUTLINE; class DENORM; -struct Pix; #define INTERSECTING INT16_MAX//no winding number diff --git a/src/ccstruct/linlsq.h b/src/ccstruct/linlsq.h index 00c4e417..4a7f09dd 100644 --- a/src/ccstruct/linlsq.h +++ b/src/ccstruct/linlsq.h @@ -1,8 +1,8 @@ /********************************************************************** * File: linlsq.h (Formerly llsq.h) * Description: Linear Least squares fitting code. - * Author: Ray Smith - * Created: Thu Sep 12 08:44:51 BST 1991 + * Author: Ray Smith + * Created: Thu Sep 12 08:44:51 BST 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,8 +20,10 @@ #ifndef TESSERACT_CCSTRUCT_LINLSQ_H_ #define TESSERACT_CCSTRUCT_LINLSQ_H_ -#include "points.h" -#include "params.h" +#include // for int32_t +#include "points.h" // for FCOORD + +template class GenericVector; class LLSQ { public: diff --git a/src/ccstruct/matrix.h b/src/ccstruct/matrix.h index 2257f7d0..209589d6 100644 --- a/src/ccstruct/matrix.h +++ b/src/ccstruct/matrix.h @@ -26,18 +26,23 @@ ** limitations under the License. * *********************************************************************************/ + #ifndef TESSERACT_CCSTRUCT_MATRIX_H_ #define TESSERACT_CCSTRUCT_MATRIX_H_ -#include -#include -#include "kdpair.h" -#include "points.h" -#include "serialis.h" -#include "unicharset.h" +#include // for max, min +#include // for sqrt, fabs, isfinite +#include // for int32_t +#include // for fread, fwrite, FILE +#include // for memcpy +#include "errcode.h" // for ASSERT_HOST +#include "helpers.h" // for ReverseN, ClipToRange +#include "kdpair.h" // for KDPairInc +#include "points.h" // for ICOORD +#include "serialis.h" // for TFile -class BLOB_CHOICE; class BLOB_CHOICE_LIST; +class UNICHARSET; #define NOT_CLASSIFIED static_cast(0) diff --git a/src/ccstruct/normalis.h b/src/ccstruct/normalis.h index 20e50114..b163c05d 100644 --- a/src/ccstruct/normalis.h +++ b/src/ccstruct/normalis.h @@ -17,26 +17,24 @@ * **********************************************************************/ -#ifndef NORMALIS_H -#define NORMALIS_H - -#include -#include "genericvector.h" -#include "host.h" +#ifndef NORMALIS_H +#define NORMALIS_H const int kBlnCellHeight = 256; // Full-height for baseline normalization. const int kBlnXHeight = 128; // x-height for baseline normalization. const int kBlnBaselineOffset = 64; // offset for baseline normalization. -struct Pix; -class ROW; // Forward decl class BLOCK; class FCOORD; -struct TBLOB; class TBOX; -struct TPOINT; class UNICHARSET; +struct Pix; +struct TBLOB; +struct TPOINT; + +template class GenericVector; + namespace tesseract { // Possible normalization methods. Use NEGATIVE values as these also @@ -314,4 +312,5 @@ class DENORM { float final_xshift_; float final_yshift_; }; + #endif diff --git a/src/ccstruct/ocrrow.h b/src/ccstruct/ocrrow.h index a72ae2e6..878f3a0e 100644 --- a/src/ccstruct/ocrrow.h +++ b/src/ccstruct/ocrrow.h @@ -17,14 +17,18 @@ * **********************************************************************/ -#ifndef OCRROW_H -#define OCRROW_H +#ifndef OCRROW_H +#define OCRROW_H -#include - -#include "quspline.h" -#include "werd.h" +#include // for int16_t, int32_t +#include // for FILE +#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK +#include "quspline.h" // for QSPLINE +#include "rect.h" // for TBOX +#include "scrollview.h" // for ScrollView, ScrollView::Color +#include "werd.h" // for WERD_LIST +class ICOORD; class TO_ROW; struct PARA; diff --git a/src/ccstruct/pageres.h b/src/ccstruct/pageres.h index 98e2e4e5..31b2f8df 100644 --- a/src/ccstruct/pageres.h +++ b/src/ccstruct/pageres.h @@ -1,7 +1,7 @@ /********************************************************************** * File: pageres.h (Formerly page_res.h) * Description: Results classes used by control.c - * Author: Phil Cheatle + * Author: Phil Cheatle * Created: Tue Sep 22 08:42:49 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. @@ -16,26 +16,43 @@ ** limitations under the License. * **********************************************************************/ -#ifndef PAGERES_H -#define PAGERES_H -#include "blamer.h" -#include "blobs.h" -#include "boxword.h" -#include "elst.h" -#include "genericvector.h" -#include "normalis.h" -#include "ocrblock.h" -#include "ocrrow.h" -#include "params_training_featdef.h" -#include "ratngs.h" -#include "rejctmap.h" -#include "seam.h" -#include "werd.h" +#ifndef PAGERES_H +#define PAGERES_H + +#include // for int32_t, int16_t +#include // for int8_t +#include "blamer.h" // for BlamerBundle (ptr only), IRR_NUM_REASONS +#include "clst.h" // for CLIST_ITERATOR, CLISTIZEH +#include "elst.h" // for ELIST_ITERATOR, ELIST_LINK, ELISTIZEH +#include "genericvector.h" // for GenericVector, PointerVector (ptr only) +#include "matrix.h" // for MATRIX +#include "normalis.h" // for DENORM +#include "ratngs.h" // for WERD_CHOICE, BLOB_CHOICE (ptr only) +#include "rect.h" // for TBOX +#include "rejctmap.h" // for REJMAP +#include "strngs.h" // for STRING +#include "unichar.h" // for UNICHAR_ID, INVALID_UNICHAR_ID +#include "unicharset.h" // for UNICHARSET, UNICHARSET::Direction, UNI... +#include "werd.h" // for WERD, W_BOL, W_EOL + +class BLOCK; +class BLOCK_LIST; +class BLOCK_RES; +class ROW; +class ROW_RES; +class SEAM; +class WERD_RES; + +struct Pix; +struct TWERD; + +template class TessResultCallback2; namespace tesseract { -struct FontInfo; -class Tesseract; + class BoxWord; + class Tesseract; + struct FontInfo; } using tesseract::FontInfo; diff --git a/src/classify/adaptmatch.cpp b/src/classify/adaptmatch.cpp index 777937c0..d825af73 100644 --- a/src/classify/adaptmatch.cpp +++ b/src/classify/adaptmatch.cpp @@ -1,5 +1,5 @@ /****************************************************************************** - ** Filename: adaptmatch.c + ** Filename: adaptmatch.cpp ** Purpose: High level adaptive matcher. ** Author: Dan Johnson ** History: Mon Mar 11 10:00:10 1991, DSJ, Created. @@ -23,43 +23,56 @@ #include "config_auto.h" #endif -#include -#include "shapeclassifier.h" -#include "ambigs.h" -#include "blobclass.h" -#include "blobs.h" -#include "callcpp.h" -#include "classify.h" -#include "const.h" -#include "dict.h" -#include "efio.h" -#include "emalloc.h" -#include "featdefs.h" -#include "float2int.h" -#include "genericvector.h" -#include "globals.h" -#include "helpers.h" -#include "intfx.h" -#include "intproto.h" -#include "mfoutline.h" -#include "normfeat.h" -#include "normmatch.h" -#include "outfeat.h" -#include "pageres.h" -#include "params.h" -#include "picofeat.h" -#include "shapetable.h" -#include "tessclassifier.h" -#include "trainingsample.h" -#include "unicharset.h" -#include "werd.h" - -#include -#include -#include -#include -#include -#include +#include // for max, min +#include // for assert +#include // for fabs +#include // for INT32_MAX, UINT8_MAX +#include // for fflush, fclose, fopen, stdout, FILE +#include // for malloc +#include // for strstr, memset, strcmp +#include "adaptive.h" // for ADAPT_CLASS, free_adapted_templates +#include "ambigs.h" // for UnicharIdVector, UnicharAmbigs +#include "bitvec.h" // for FreeBitVector, NewBitVector, BIT_VECTOR +#include "blobs.h" // for TBLOB, TWERD +#include "callcpp.h" // for cprintf, window_wait +#include "classify.h" // for Classify, CST_FRAGMENT, CST_WHOLE +#include "dict.h" // for Dict +#include "errcode.h" // for ASSERT_HOST +#include "featdefs.h" // for CharNormDesc +#include "float2int.h" // for BASELINE_Y_SHIFT +#include "fontinfo.h" // for ScoredFont, FontSet +#include "genericvector.h" // for GenericVector +#include "helpers.h" // for IntCastRounded, ClipToRange +#include "host.h" // for FLOAT32, FALSE, MAX_FLOAT32, TRUE +#include "intfx.h" // for BlobToTrainingSample, INT_FX_RESULT_S... +#include "intmatcher.h" // for CP_RESULT_STRUCT, IntegerMatcher +#include "intproto.h" // for INT_FEATURE_STRUCT, (anonymous), Clas... +#include "matchdefs.h" // for CLASS_ID, FEATURE_ID, PROTO_ID, NO_PROTO +#include "mfoutline.h" // for baseline, character, MF_SCALE_FACTOR +#include "normalis.h" // for DENORM, kBlnBaselineOffset, kBlnXHeight +#include "normfeat.h" // for ActualOutlineLength, CharNormLength +#include "ocrfeatures.h" // for FEATURE_STRUCT, FreeFeatureSet, FEATURE +#include "oldlist.h" // for push, delete_d +#include "outfeat.h" // for OutlineFeatDir, OutlineFeatLength +#include "pageres.h" // for WERD_RES +#include "params.h" // for IntParam, BoolParam, DoubleParam, Str... +#include "picofeat.h" // for PicoFeatDir, PicoFeatX, PicoFeatY +#include "protos.h" // for PROTO_STRUCT, FillABC, PROTO +#include "ratngs.h" // for BLOB_CHOICE_IT, BLOB_CHOICE_LIST, BLO... +#include "rect.h" // for TBOX +#include "scrollview.h" // for ScrollView, ScrollView::BROWN, Scroll... +#include "seam.h" // for SEAM +#include "serialis.h" // for TFile +#include "shapeclassifier.h" // for ShapeClassifier +#include "shapetable.h" // for UnicharRating, ShapeTable, Shape, Uni... +#include "strngs.h" // for STRING +#include "tessclassifier.h" // for TessClassifier +#include "tessdatamanager.h" // for TessdataManager, TESSDATA_INTTEMP +#include "tprintf.h" // for tprintf +#include "trainingsample.h" // for TrainingSample +#include "unichar.h" // for UNICHAR_ID, INVALID_UNICHAR_ID +#include "unicharset.h" // for UNICHARSET, CHAR_FRAGMENT, UNICHAR_SPACE +#include "unicity_table.h" // for UnicityTable #define ADAPT_TEMPLATE_SUFFIX ".a" diff --git a/unittest/intsimdmatrix_test.cc b/unittest/intsimdmatrix_test.cc index 3d210842..84406c3a 100644 --- a/unittest/intsimdmatrix_test.cc +++ b/unittest/intsimdmatrix_test.cc @@ -20,6 +20,7 @@ #include "include_gunit.h" #include "intsimdmatrixavx2.h" #include "intsimdmatrixsse.h" +#include "matrix.h" #include "simddetect.h" #include "tprintf.h"