mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-10 03:42:41 +08:00
moved ccstruct/callcpp.cpp to cutil (to header file - see issue 414); moved vs2008/include/stdint.h to vs2008/port/stdint.h so we can use vs2008/include also for mingw; removed unused tessembedded.*
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@603 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
16f0481f5c
commit
4abdfdb8fe
@ -9,14 +9,12 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir)/neural_networks/runtime -I$(top_srcdir)/cube \
|
-I$(top_srcdir)/neural_networks/runtime -I$(top_srcdir)/cube \
|
||||||
-I$(top_srcdir)/textord
|
-I$(top_srcdir)/textord
|
||||||
|
|
||||||
EXTRA_DIST = tessembedded.cpp
|
|
||||||
|
|
||||||
include_HEADERS = \
|
include_HEADERS = \
|
||||||
control.h cube_reco_context.h \
|
control.h cube_reco_context.h \
|
||||||
docqual.h fixspace.h \
|
docqual.h fixspace.h \
|
||||||
imgscale.h osdetect.h output.h \
|
imgscale.h osdetect.h output.h \
|
||||||
paramsd.h pgedit.h reject.h scaleimg.h \
|
paramsd.h pgedit.h reject.h scaleimg.h \
|
||||||
tessbox.h tessedit.h tessembedded.h tesseractclass.h \
|
tessbox.h tessedit.h tesseractclass.h \
|
||||||
tesseract_cube_combiner.h \
|
tesseract_cube_combiner.h \
|
||||||
tessvars.h tfacep.h tfacepp.h thresholder.h \
|
tessvars.h tfacep.h tfacepp.h thresholder.h \
|
||||||
werdit.h
|
werdit.h
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
/**********************************************************************
|
|
||||||
* File: tessembedded.cpp
|
|
||||||
* Description: Main program for merge of tess and editor.
|
|
||||||
* Author: Marius Renn
|
|
||||||
* Created: Sun Oct 21 2006
|
|
||||||
*
|
|
||||||
* (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.
|
|
||||||
*
|
|
||||||
**********************************************************************/
|
|
||||||
|
|
||||||
#include "mfcpch.h"
|
|
||||||
#include "applybox.h"
|
|
||||||
#include "control.h"
|
|
||||||
#include "tessvars.h"
|
|
||||||
#include "tessedit.h"
|
|
||||||
#include "pageres.h"
|
|
||||||
#include "imgs.h"
|
|
||||||
#include "varabled.h"
|
|
||||||
#include "tprintf.h"
|
|
||||||
#include "tessembedded.h"
|
|
||||||
#include "stderr.h"
|
|
||||||
#include "notdll.h"
|
|
||||||
#include "mainblk.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "tfacep.h"
|
|
||||||
#include "callnet.h"
|
|
||||||
|
|
||||||
void tessembedded_read_file(STRING &name,
|
|
||||||
BLOCK_LIST *blocks) {
|
|
||||||
int c; //input character
|
|
||||||
FILE *infp; //input file
|
|
||||||
BLOCK_IT block_it(blocks); //iterator
|
|
||||||
BLOCK *block; //current block
|
|
||||||
|
|
||||||
ICOORD page_tr; //topright of page
|
|
||||||
|
|
||||||
char *filename_extension;
|
|
||||||
|
|
||||||
block_it.move_to_last ();
|
|
||||||
|
|
||||||
// ptr to last dot
|
|
||||||
filename_extension = strrchr (name.string (), '.');
|
|
||||||
#ifdef __UNIX__
|
|
||||||
if (strcmp (filename_extension, ".pb") == 0) {
|
|
||||||
tprintf ("Converting from .pb file format.\n");
|
|
||||||
//construct blocks
|
|
||||||
read_and_textord (name.string (), blocks);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
//xiaofan, a hack here
|
|
||||||
if (strcmp (filename_extension, ".tif") == 0) {
|
|
||||||
// tprintf( "Interpreting .bl file format.\n" );
|
|
||||||
//construct blocks
|
|
||||||
edges_and_textord (name.string (), blocks);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ((strcmp (filename_extension, ".pg") == 0) ||
|
|
||||||
// read a .pg file
|
|
||||||
// or a .sp file
|
|
||||||
(strcmp (filename_extension, ".sp") == 0)) {
|
|
||||||
tprintf ("Reading %s file format.\n", filename_extension);
|
|
||||||
infp = fopen (name.string (), "r");
|
|
||||||
if (infp == NULL)
|
|
||||||
CANTOPENFILE.error ("pgeditor_read_file", EXIT, name.string ());
|
|
||||||
//can't open file
|
|
||||||
|
|
||||||
while (((c = fgetc (infp)) != EOF) && (ungetc (c, infp) != EOF)) {
|
|
||||||
//get one
|
|
||||||
block = BLOCK::de_serialise (infp);
|
|
||||||
//add to list
|
|
||||||
block_it.add_after_then_move (block);
|
|
||||||
}
|
|
||||||
fclose(infp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int init_tessembedded(const char *arg0,
|
|
||||||
const char *textbase,
|
|
||||||
const char *configfile,
|
|
||||||
int configc,
|
|
||||||
const char *const *configv) {
|
|
||||||
main_setup(arg0, textbase, configc, configv);
|
|
||||||
|
|
||||||
debug_window_on.set_value (FALSE);
|
|
||||||
|
|
||||||
static char c_path[MAX_PATH]; //path for c code
|
|
||||||
strcpy (c_path, datadir.string ());
|
|
||||||
c_path[strlen (c_path) - strlen (m_data_sub_dir.string ())] = '\0';
|
|
||||||
demodir = c_path;
|
|
||||||
start_recog(configfile, textbase);
|
|
||||||
|
|
||||||
init_net();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void end_tessembedded() {
|
|
||||||
end_recog();
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
/**********************************************************************
|
|
||||||
* File: tessembedded.h
|
|
||||||
* Description: Access to initialization functions in embedded environment
|
|
||||||
* Author: Marius Renn
|
|
||||||
* Created: Sun Oct 21
|
|
||||||
*
|
|
||||||
* (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 TESSEMBEDDED_H
|
|
||||||
#define TESSEMBEDDED_H
|
|
||||||
|
|
||||||
#include "ocrblock.h"
|
|
||||||
#include "varable.h"
|
|
||||||
#include "notdll.h"
|
|
||||||
|
|
||||||
int init_tessembedded(const char *arg0,
|
|
||||||
const char *textbase,
|
|
||||||
const char *configfile,
|
|
||||||
int configc,
|
|
||||||
const char *const *configv);
|
|
||||||
|
|
||||||
void tessembedded_read_file(STRING &name,
|
|
||||||
BLOCK_LIST *blocks);
|
|
||||||
|
|
||||||
void end_tessembedded();
|
|
||||||
|
|
||||||
#endif
|
|
@ -15,7 +15,7 @@ include_HEADERS = \
|
|||||||
|
|
||||||
lib_LTLIBRARIES = libtesseract_ccstruct.la
|
lib_LTLIBRARIES = libtesseract_ccstruct.la
|
||||||
libtesseract_ccstruct_la_SOURCES = \
|
libtesseract_ccstruct_la_SOURCES = \
|
||||||
blobbox.cpp blobs.cpp blread.cpp boxword.cpp callcpp.cpp ccstruct.cpp coutln.cpp \
|
blobbox.cpp blobs.cpp blread.cpp boxword.cpp ccstruct.cpp coutln.cpp \
|
||||||
detlinefit.cpp dppoint.cpp genblob.cpp \
|
detlinefit.cpp dppoint.cpp genblob.cpp \
|
||||||
linlsq.cpp matrix.cpp mod128.cpp normalis.cpp \
|
linlsq.cpp matrix.cpp mod128.cpp normalis.cpp \
|
||||||
ocrblock.cpp ocrrow.cpp otsuthr.cpp \
|
ocrblock.cpp ocrrow.cpp otsuthr.cpp \
|
||||||
|
@ -8,7 +8,7 @@ include_HEADERS = \
|
|||||||
|
|
||||||
lib_LTLIBRARIES = libtesseract_cutil.la
|
lib_LTLIBRARIES = libtesseract_cutil.la
|
||||||
libtesseract_cutil_la_SOURCES = \
|
libtesseract_cutil_la_SOURCES = \
|
||||||
bitvec.cpp cutil.cpp cutil_class.cpp danerror.cpp efio.cpp \
|
bitvec.cpp callcpp.cpp cutil.cpp cutil_class.cpp danerror.cpp efio.cpp \
|
||||||
emalloc.cpp freelist.cpp listio.cpp oldheap.cpp \
|
emalloc.cpp freelist.cpp listio.cpp oldheap.cpp \
|
||||||
oldlist.cpp structures.cpp tessarray.cpp
|
oldlist.cpp structures.cpp tessarray.cpp
|
||||||
|
|
||||||
|
@ -868,10 +868,6 @@
|
|||||||
RelativePath="..\ccmain\tessedit.h"
|
RelativePath="..\ccmain\tessedit.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\ccmain\tessembedded.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\ccmain\tesseract_cube_combiner.h"
|
RelativePath="..\ccmain\tesseract_cube_combiner.h"
|
||||||
>
|
>
|
||||||
|
@ -312,37 +312,6 @@
|
|||||||
RelativePath="..\ccstruct\boxword.cpp"
|
RelativePath="..\ccstruct\boxword.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\ccstruct\callcpp.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="2"
|
|
||||||
PrecompiledHeaderThrough="mfcpch.h"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="2"
|
|
||||||
PrecompiledHeaderThrough="mfcpch.h"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release.dynamic|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="2"
|
|
||||||
PrecompiledHeaderThrough="mfcpch.h"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\ccstruct\ccstruct.cpp"
|
RelativePath="..\ccstruct\ccstruct.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9.00"
|
Version="9,00"
|
||||||
Name="cutil"
|
Name="cutil"
|
||||||
ProjectGUID="{0BDEFC56-679F-436E-A089-81FCAEBA50F3}"
|
ProjectGUID="{0BDEFC56-679F-436E-A089-81FCAEBA50F3}"
|
||||||
RootNamespace="cutil"
|
RootNamespace="cutil"
|
||||||
@ -219,6 +219,10 @@
|
|||||||
RelativePath="..\cutil\bitvec.cpp"
|
RelativePath="..\cutil\bitvec.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\cutil\callcpp.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\cutil\cutil.cpp"
|
RelativePath="..\cutil\cutil.cpp"
|
||||||
>
|
>
|
||||||
|
@ -93,7 +93,6 @@
|
|||||||
<ClInclude Include="..\ccmain\scaleimg.h" />
|
<ClInclude Include="..\ccmain\scaleimg.h" />
|
||||||
<ClInclude Include="..\ccmain\tessbox.h" />
|
<ClInclude Include="..\ccmain\tessbox.h" />
|
||||||
<ClInclude Include="..\ccmain\tessedit.h" />
|
<ClInclude Include="..\ccmain\tessedit.h" />
|
||||||
<ClInclude Include="..\ccmain\tessembedded.h" />
|
|
||||||
<ClInclude Include="..\ccmain\tesseractclass.h" />
|
<ClInclude Include="..\ccmain\tesseractclass.h" />
|
||||||
<ClInclude Include="..\ccmain\tesseract_cube_combiner.h" />
|
<ClInclude Include="..\ccmain\tesseract_cube_combiner.h" />
|
||||||
<ClInclude Include="..\ccmain\tessvars.h" />
|
<ClInclude Include="..\ccmain\tessvars.h" />
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
<ClCompile Include="..\ccstruct\blobs.cpp" />
|
<ClCompile Include="..\ccstruct\blobs.cpp" />
|
||||||
<ClCompile Include="..\ccstruct\blread.cpp" />
|
<ClCompile Include="..\ccstruct\blread.cpp" />
|
||||||
<ClCompile Include="..\ccstruct\boxword.cpp" />
|
<ClCompile Include="..\ccstruct\boxword.cpp" />
|
||||||
<ClCompile Include="..\ccstruct\callcpp.cpp" />
|
|
||||||
<ClCompile Include="..\ccstruct\ccstruct.cpp" />
|
<ClCompile Include="..\ccstruct\ccstruct.cpp" />
|
||||||
<ClCompile Include="..\ccstruct\coutln.cpp" />
|
<ClCompile Include="..\ccstruct\coutln.cpp" />
|
||||||
<ClCompile Include="..\ccstruct\detlinefit.cpp" />
|
<ClCompile Include="..\ccstruct\detlinefit.cpp" />
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\cutil\bitvec.cpp" />
|
<ClCompile Include="..\cutil\bitvec.cpp" />
|
||||||
|
<ClCompile Include="..\cutil\callcpp.cpp" />
|
||||||
<ClCompile Include="..\cutil\cutil.cpp" />
|
<ClCompile Include="..\cutil\cutil.cpp" />
|
||||||
<ClCompile Include="..\cutil\cutil_class.cpp" />
|
<ClCompile Include="..\cutil\cutil_class.cpp" />
|
||||||
<ClCompile Include="..\cutil\danerror.cpp" />
|
<ClCompile Include="..\cutil\danerror.cpp" />
|
||||||
|
Loading…
Reference in New Issue
Block a user