Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 0516e0b

Browse files
committed
build tesseract 3.04.01
0 parents  commit 0516e0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+24398
-0
lines changed

build32.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Using patched imagemagick sources from msys2
2+
# Link against dependency C libs from msys2
3+
export CC="gcc -m32"
4+
export CXX="g++ -m32 -std=c++0x"
5+
export CPPFLAGS="-I/local/include" #for libtiff only
6+
export LIBLEPT_HEADERSDIR="/c/msys2-i686/mingw32/include/leptonica"
7+
export LDFLAGS="-m32 -L/c/msys2-i686/mingw32/lib"
8+
../tesseract-3.04.01/configure \
9+
--disable-openmp \
10+
--enable-static \
11+
--disable-shared

build64.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Using patched imagemagick sources from msys2
2+
# Link against dependency C libs from msys2
3+
export CC="gcc -m64"
4+
export CXX="g++ -m64 -std=c++0x"
5+
export CPPFLAGS="-I/local/include" #for libtiff only
6+
export LIBLEPT_HEADERSDIR="/c/msys2-x64/mingw64/include/leptonica"
7+
export LDFLAGS="-m64 -L/c/msys2-x64/mingw64/lib"
8+
../tesseract-3.04.01/configure \
9+
--disable-openmp \
10+
--enable-static \
11+
--disable-shared
12+
13+
make

include/leptonica/allheaders.h

Lines changed: 2636 additions & 0 deletions
Large diffs are not rendered by default.

include/leptonica/alltypes.h

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*====================================================================*
2+
- Copyright (C) 2001 Leptonica. All rights reserved.
3+
-
4+
- Redistribution and use in source and binary forms, with or without
5+
- modification, are permitted provided that the following conditions
6+
- are met:
7+
- 1. Redistributions of source code must retain the above copyright
8+
- notice, this list of conditions and the following disclaimer.
9+
- 2. Redistributions in binary form must reproduce the above
10+
- copyright notice, this list of conditions and the following
11+
- disclaimer in the documentation and/or other materials
12+
- provided with the distribution.
13+
-
14+
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18+
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19+
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20+
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21+
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22+
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23+
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*====================================================================*/
26+
27+
#ifndef LEPTONICA_ALLTYPES_H
28+
#define LEPTONICA_ALLTYPES_H
29+
30+
/* Standard */
31+
#include <stdio.h>
32+
#include <stdlib.h>
33+
#include <stdarg.h>
34+
35+
/* General and configuration defs */
36+
#include "environ.h"
37+
38+
/* Generic and non-image-specific containers */
39+
#include "array.h"
40+
#include "bbuffer.h"
41+
#include "heap.h"
42+
#include "list.h"
43+
#include "ptra.h"
44+
#include "queue.h"
45+
#include "rbtree.h"
46+
#include "stack.h"
47+
48+
/* Imaging */
49+
#include "arrayaccess.h"
50+
#include "bmf.h"
51+
#include "ccbord.h"
52+
#include "dewarp.h"
53+
#include "gplot.h"
54+
#include "imageio.h"
55+
#include "jbclass.h"
56+
#include "morph.h"
57+
#include "pix.h"
58+
#include "recog.h"
59+
#include "regutils.h"
60+
#include "stringcode.h"
61+
#include "sudoku.h"
62+
#include "watershed.h"
63+
64+
65+
#endif /* LEPTONICA_ALLTYPES_H */

include/leptonica/array.h

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/*====================================================================*
2+
- Copyright (C) 2001 Leptonica. All rights reserved.
3+
-
4+
- Redistribution and use in source and binary forms, with or without
5+
- modification, are permitted provided that the following conditions
6+
- are met:
7+
- 1. Redistributions of source code must retain the above copyright
8+
- notice, this list of conditions and the following disclaimer.
9+
- 2. Redistributions in binary form must reproduce the above
10+
- copyright notice, this list of conditions and the following
11+
- disclaimer in the documentation and/or other materials
12+
- provided with the distribution.
13+
-
14+
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18+
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19+
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20+
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21+
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22+
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23+
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*====================================================================*/
26+
27+
#ifndef LEPTONICA_ARRAY_H
28+
#define LEPTONICA_ARRAY_H
29+
30+
/*
31+
* Contains the following structs:
32+
* struct Numa
33+
* struct Numaa
34+
* struct L_Dna
35+
* struct L_Dnaa
36+
* struct L_DnaHash
37+
* struct Sarray
38+
* struct L_Bytea
39+
*
40+
* Contains definitions for:
41+
* Numa interpolation flags
42+
* Numa and FPix border flags
43+
* Numa data type conversion to string
44+
*/
45+
46+
47+
/*------------------------------------------------------------------------*
48+
* Array Structs *
49+
*------------------------------------------------------------------------*/
50+
51+
#define NUMA_VERSION_NUMBER 1
52+
53+
/* Number array: an array of floats */
54+
struct Numa
55+
{
56+
l_int32 nalloc; /* size of allocated number array */
57+
l_int32 n; /* number of numbers saved */
58+
l_int32 refcount; /* reference count (1 if no clones) */
59+
l_float32 startx; /* x value assigned to array[0] */
60+
l_float32 delx; /* change in x value as i --> i + 1 */
61+
l_float32 *array; /* number array */
62+
};
63+
typedef struct Numa NUMA;
64+
65+
/* Array of number arrays */
66+
struct Numaa
67+
{
68+
l_int32 nalloc; /* size of allocated ptr array */
69+
l_int32 n; /* number of Numa saved */
70+
struct Numa **numa; /* array of Numa */
71+
};
72+
typedef struct Numaa NUMAA;
73+
74+
#define DNA_VERSION_NUMBER 1
75+
76+
/* Double number array: an array of doubles */
77+
struct L_Dna
78+
{
79+
l_int32 nalloc; /* size of allocated number array */
80+
l_int32 n; /* number of numbers saved */
81+
l_int32 refcount; /* reference count (1 if no clones) */
82+
l_float64 startx; /* x value assigned to array[0] */
83+
l_float64 delx; /* change in x value as i --> i + 1 */
84+
l_float64 *array; /* number array */
85+
};
86+
typedef struct L_Dna L_DNA;
87+
88+
/* Array of double number arrays */
89+
struct L_Dnaa
90+
{
91+
l_int32 nalloc; /* size of allocated ptr array */
92+
l_int32 n; /* number of L_Dna saved */
93+
struct L_Dna **dna; /* array of L_Dna */
94+
};
95+
typedef struct L_Dnaa L_DNAA;
96+
97+
/* A hash table of Dnas */
98+
struct L_DnaHash
99+
{
100+
l_int32 nbuckets;
101+
l_int32 initsize; /* initial size of each dna that is made */
102+
struct L_Dna **dna;
103+
};
104+
typedef struct L_DnaHash L_DNAHASH;
105+
106+
#define SARRAY_VERSION_NUMBER 1
107+
108+
/* String array: an array of C strings */
109+
struct Sarray
110+
{
111+
l_int32 nalloc; /* size of allocated ptr array */
112+
l_int32 n; /* number of strings allocated */
113+
l_int32 refcount; /* reference count (1 if no clones) */
114+
char **array; /* string array */
115+
};
116+
typedef struct Sarray SARRAY;
117+
118+
/* Byte array (analogous to C++ "string") */
119+
struct L_Bytea
120+
{
121+
size_t nalloc; /* number of bytes allocated in data array */
122+
size_t size; /* number of bytes presently used */
123+
l_int32 refcount; /* reference count (1 if no clones) */
124+
l_uint8 *data; /* data array */
125+
};
126+
typedef struct L_Bytea L_BYTEA;
127+
128+
129+
/*------------------------------------------------------------------------*
130+
* Array flags *
131+
*------------------------------------------------------------------------*/
132+
/* Flags for interpolation in Numa */
133+
enum {
134+
L_LINEAR_INTERP = 1, /* linear */
135+
L_QUADRATIC_INTERP = 2 /* quadratic */
136+
};
137+
138+
/* Flags for added borders in Numa and Fpix */
139+
enum {
140+
L_CONTINUED_BORDER = 1, /* extended with same value */
141+
L_SLOPE_BORDER = 2, /* extended with constant normal derivative */
142+
L_MIRRORED_BORDER = 3 /* mirrored */
143+
};
144+
145+
/* Flags for data type converted from Numa */
146+
enum {
147+
L_INTEGER_VALUE = 1, /* convert to integer */
148+
L_FLOAT_VALUE = 2 /* convert to float */
149+
};
150+
151+
152+
#endif /* LEPTONICA_ARRAY_H */

0 commit comments

Comments
 (0)