Skip to content

Commit

Permalink
correction of ambigs.train;
Browse files Browse the repository at this point in the history
win32: update of leptonica library to 1.66, update of tessdll.dll to recent build

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@462 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
zdenop@gmail.com committed Sep 27, 2010
1 parent fe0e38f commit 68baf25
Show file tree
Hide file tree
Showing 19 changed files with 1,072 additions and 138 deletions.
2 changes: 1 addition & 1 deletion include/allheaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


#define LIBLEPT_MAJOR_VERSION 1
#define LIBLEPT_MINOR_VERSION 62
#define LIBLEPT_MINOR_VERSION 66

#include "alltypes.h"

Expand Down
2 changes: 2 additions & 0 deletions include/alltypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "bbuffer.h"
#include "bmf.h"
#include "ccbord.h"
#include "dewarp.h"
#include "gplot.h"
#include "heap.h"
#include "jbclass.h"
Expand All @@ -32,6 +33,7 @@
#include "pix.h"
#include "ptra.h"
#include "queue.h"
#include "regutils.h"
#include "stack.h"
#include "watershed.h"

Expand Down
10 changes: 5 additions & 5 deletions include/arrayaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


#if 1 /* Inline Accessors */
#ifndef COMPILER_MSVC
#ifndef _MSC_VER

/*--------------------------------------------------*
* 1 bit access *
Expand Down Expand Up @@ -80,7 +80,7 @@
({l_uint32 *_TEMP_WORD_PTR_; \
_TEMP_WORD_PTR_ = (l_uint32 *)(pdata) + ((n) >> 4); \
*_TEMP_WORD_PTR_ &= ~(0xc0000000 >> (2 * ((n) & 15))); \
*_TEMP_WORD_PTR_ |= ((val) << (30 - 2 * ((n) & 15))); \
*_TEMP_WORD_PTR_ |= (((val) & 3) << (30 - 2 * ((n) & 15))); \
})

#define CLEAR_DATA_DIBIT(pdata, n) \
Expand All @@ -97,7 +97,7 @@
({l_uint32 *_TEMP_WORD_PTR_; \
_TEMP_WORD_PTR_ = (l_uint32 *)(pdata) + ((n) >> 3); \
*_TEMP_WORD_PTR_ &= ~(0xf0000000 >> (4 * ((n) & 7))); \
*_TEMP_WORD_PTR_ |= ((val) << (28 - 4 * ((n) & 7))); \
*_TEMP_WORD_PTR_ |= (((val) & 15) << (28 - 4 * ((n) & 7))); \
})

#define CLEAR_DATA_QBIT(pdata, n) \
Expand Down Expand Up @@ -154,15 +154,15 @@
(*((l_uint32 *)(pdata) + (n)) = (val))


#endif /* COMPILER_MSVC */
#endif /* ! _MSC_VER */
#endif /* Inline Accessors */



/*--------------------------------------------------*
* Slower, using function calls for all accessors *
*--------------------------------------------------*/
#if 0 || COMPILER_MSVC
#if 0 || defined(_MSC_VER)
#define GET_DATA_BIT(pdata, n) l_getDataBit(pdata, n)
#define SET_DATA_BIT(pdata, n) l_setDataBit(pdata, n)
#define CLEAR_DATA_BIT(pdata, n) l_clearDataBit(pdata, n)
Expand Down
4 changes: 2 additions & 2 deletions include/bmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum {
};


struct Bmf
struct L_Bmf
{
struct Pixa *pixa; /* pixa of bitmaps for 93 characters */
l_int32 size; /* font size (in points at 300 ppi) */
Expand All @@ -46,6 +46,6 @@ struct Bmf
l_int32 *baselinetab; /* table mapping ascii --> baseline offset */
l_int32 *widthtab; /* table mapping ascii --> char width */
};
typedef struct Bmf BMF;
typedef struct L_Bmf L_BMF;

#endif /* LEPTONICA_BMF_H */
74 changes: 74 additions & 0 deletions include/bmp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/

#ifndef LEPTONICA_BMP_H
#define LEPTONICA_BMP_H

/*
* This file is here to describe the fields in the header of
* the BMP file. These fields are not used directly in Leptonica.
* The only thing we use are the sizes of these two headers.
* Furthermore, because of potential namespace conflicts with
* the typedefs and defined sizes, we have changed the names
* to protect anyone who may also need to use the original definitions.
* Thanks to J. D. Bryan for pointing out the potential problems when
* developing on Win32 compatible systems.
*/

/*-------------------------------------------------------------*
* BMP file header *
*-------------------------------------------------------------*/
struct BMP_FileHeader
{
l_int16 bfType; /* file type; must be "BM" */
l_int16 bfSize; /* length of the file;
sizeof(BMP_FileHeader) +
sizeof(BMP_InfoHeader) +
size of color table +
size of DIB bits */
l_int16 bfFill1; /* remainder of the bfSize field */
l_int16 bfReserved1; /* don't care (set to 0)*/
l_int16 bfReserved2; /* don't care (set to 0)*/
l_int16 bfOffBits; /* offset from beginning of file */
l_int16 bfFill2; /* remainder of the bfOffBits field */
};
typedef struct BMP_FileHeader BMP_FH;

#define BMP_FHBYTES sizeof(BMP_FH)


/*-------------------------------------------------------------*
* BMP info header *
*-------------------------------------------------------------*/
struct BMP_InfoHeader
{
l_int32 biSize; /* size of the BMP_InfoHeader struct */
l_int32 biWidth; /* bitmap width in pixels */
l_int32 biHeight; /* bitmap height in pixels */
l_int16 biPlanes; /* number of bitmap planes */
l_int16 biBitCount; /* number of bits per pixel */
l_int32 biCompression; /* compression format (0 == uncompressed) */
l_int32 biSizeImage; /* size of image in bytes */
l_int32 biXPelsPerMeter; /* pixels per meter in x direction */
l_int32 biYPelsPerMeter; /* pixels per meter in y direction */
l_int32 biClrUsed; /* number of colors used */
l_int32 biClrImportant; /* number of important colors used */
};
typedef struct BMP_InfoHeader BMP_IH;

#define BMP_IHBYTES sizeof(BMP_IH)


#endif /* LEPTONICA_BMP_H */
55 changes: 55 additions & 0 deletions include/dewarp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/

#ifndef LEPTONICA_DEWARP_H
#define LEPTONICA_DEWARP_H

/*
* dewarp.h
*
* Data structure to hold arrays and results for generating
* a vertical disparity array based on textlines. The disparity
* array is two-dimensional, and it represents a vertical
* displacement, relative to the flat point in the textlines.
* After dewarping, all points on the altered curve will have
* a y-value equal to the flat point.
*
* The sampled vertical disparity array is expanded to full resolution,
* using linear interpolation, from which it is trivially applied
* to the input image.
*/


struct L_Dewarp
{
struct Pix *pixs; /* source pix, 1 bpp */
struct Pix *pixd; /* dewarped pix; 1, 8 or 32 bpp */
struct FPix *sampvdispar; /* sampled vertical disparity array */
struct FPix *fullvdispar; /* full vertical disparity array */
struct FPix *fullhdispar; /* full horiztontal disparity array */
struct Numa *naflats; /* sorted flat location of each line */
struct Numa *nacurves; /* sorted curvature of each line */
l_int32 sampling; /* sampling factor of disparity array */
l_int32 minlines; /* min number of long lines required */
l_int32 applyhoriz; /* flag for estimating horiz. disparity */
l_int32 nx; /* number of sampling pts in x direction */
l_int32 ny; /* number of sampling pts in y direction */
l_int32 extraw; /* extra width required for hor. disparity */
l_int32 success; /* sets to 1 if model build succeeds */

};
typedef struct L_Dewarp L_DEWARP;

#endif /* LEPTONICA_DEWARP_H */
55 changes: 41 additions & 14 deletions include/environ.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,33 @@
#ifndef LEPTONICA_ENVIRON_H
#define LEPTONICA_ENVIRON_H

#if defined(WIN32) || defined(WIN64)
/* WINDOWS_SPECIFICS */
/* Provide intptr_t from the non-existent stdint.h. */
#if defined(WIN32)
/*------------------------------------------------------------------------*
* Defines and includes differ for Unix and Windows. Also for Windows, *
* differentiate between conditionals based on platform and compiler. *
* For platforms: *
* _WIN32 => Windows, 32- or 64-bit *
* _WIN64 => Windows, 64-bit only *
* __CYGWIN__ => Cygwin *
* For compilers: *
* __GNUC__ => gcc *
* _MSC_VER => msvc *
*------------------------------------------------------------------------*/

/* MS VC++ does not provide stdint.h, so define the missing types here */

#ifndef _MSC_VER
#include <stdint.h>

#else
/* Note that _WIN32 is defined for both 32 and 64 bit applications,
whereas _WIN64 is defined only for the latter */

#ifdef _WIN64
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef int intptr_t;
typedef unsigned int uintptr_t;
#else
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
#endif

/* VC++6 doesn't seem to have powf, expf. */
Expand All @@ -33,6 +51,12 @@ typedef unsigned long int uintptr_t;
#define expf(x) (float)exp((double)(x))
#endif

#endif /* _MSC_VER */

/* Windows specifics */

#ifdef _WIN32

/* DLL EXPORT/IMPORT */
#ifdef LEPTONLIB_EXPORTS
#define LEPT_DLL __declspec(dllexport)
Expand All @@ -41,10 +65,11 @@ typedef unsigned long int uintptr_t;
#else
#define LEPT_DLL
#endif

#else /* non-WINDOWS-SPECIFICS */
#include <stdint.h>
#define LEPT_DLL
#endif
#endif /* _WIN32 */

typedef intptr_t l_intptr_t;
typedef uintptr_t l_uintptr_t;
Expand All @@ -59,23 +84,23 @@ typedef uintptr_t l_uintptr_t;
*--------------------------------------------------------------------*/
/*
* Leptonica provides interfaces to link to four external image I/O
* libraries, plus zlib. Setting any of these to 0 causes
* libraries, plus zlib. Setting any of these to 0 here causes
* non-functioning stubs to be linked.
*/
#ifndef HAVE_CONFIG_H
#define HAVE_LIBJPEG 1
#define HAVE_LIBTIFF 1
#define HAVE_LIBPNG 1
#define HAVE_LIBZ 1
#define HAVE_LIBGIF 0
#define HAVE_LIBGIF 1
#define HAVE_LIBUNGIF 0
#endif /* ~HAVE_CONFIG_H */

/*
* On linux systems, you can do I/O between Pix and memory. Specifically,
* you can compress (write compressed data to memory from a Pix) and
* uncompress (read from compressed data in memory to a Pix).
* For all but TIFF and PS, these use the non-posix GNU functions
* For jpeg, png, pnm and bmp, these use the non-posix GNU functions
* fmemopen() and open_memstream(). These functions are not
* available on other systems. To use these functions in linux,
* you must define HAVE_FMEMOPEN to be 1 here.
Expand Down Expand Up @@ -196,15 +221,16 @@ enum {
#define ERROR_PTR(a,b,c) ((void *)(c))
#define ERROR_INT(a,b,c) ((l_int32)(c))
#define ERROR_FLOAT(a,b,c) ((l_float32)(c))
#define ERROR_VOID(a,b)
#define L_ERROR(a,b)
#define L_ERROR_STRING(a,b,c)
#define L_ERROR_INT(a,b,c)
#define L_ERROR_FLOAT(a,b,c)
#define L_WARNING(a,b)
#define L_WARNING_STRING(a,b,c)
#define L_WARNING_INT(a,b,c)
#define L_WARNING_INT2(a,b,c,d)
#define L_WARNING_FLOAT(a,b,c)
#define L_WARNING_FLOAT2(a,b,c,d)
#define L_INFO(a,b)
#define L_INFO_STRING(a,b,c)
#define L_INFO_INT(a,b,c)
Expand All @@ -218,15 +244,16 @@ enum {
#define ERROR_PTR(a,b,c) returnErrorPtr((a),(b),(c))
#define ERROR_INT(a,b,c) returnErrorInt((a),(b),(c))
#define ERROR_FLOAT(a,b,c) returnErrorFloat((a),(b),(c))
#define ERROR_VOID(a,b) returnErrorVoid((a),(b))
#define L_ERROR(a,b) l_error((a),(b))
#define L_ERROR_STRING(a,b,c) l_errorString((a),(b),(c))
#define L_ERROR_INT(a,b,c) l_errorInt((a),(b),(c))
#define L_ERROR_FLOAT(a,b,c) l_errorFloat((a),(b),(c))
#define L_WARNING(a,b) l_warning((a),(b))
#define L_WARNING_STRING(a,b,c) l_warningString((a),(b),(c))
#define L_WARNING_INT(a,b,c) l_warningInt((a),(b),(c))
#define L_WARNING_INT2(a,b,c,d) l_warningInt2((a),(b),(c),(d))
#define L_WARNING_FLOAT(a,b,c) l_warningFloat((a),(b),(c))
#define L_WARNING_FLOAT2(a,b,c,d) l_warningFloat2((a),(b),(c),(d))
#define L_INFO(a,b) l_info((a),(b))
#define L_INFO_STRING(a,b,c) l_infoString((a),(b),(c))
#define L_INFO_INT(a,b,c) l_infoInt((a),(b),(c))
Expand All @@ -240,7 +267,7 @@ enum {
/*------------------------------------------------------------------------*
* snprintf() renamed in MSVC *
*------------------------------------------------------------------------*/
#if defined(__MINGW32__) || defined(WIN32)
#ifdef _MSC_VER
#define snprintf _snprintf
#endif

Expand Down
23 changes: 23 additions & 0 deletions include/freetype.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*====================================================================*
- Copyright (C) 2008 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/

#ifndef LEPTONICA_FREETYPE_H
#define LEPTONICA_FREETYPE_H

#define LEPTONICA_FT_RESOLUTION 96

typedef struct ft_library_st FT_LIBRARY;

#endif /* LEPTONICA_FREETYPE_H */
Loading

0 comments on commit 68baf25

Please sign in to comment.