// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'TransOcr.pas' rev: 4.00

#ifndef TransOcrHPP
#define TransOcrHPP

#pragma delphiheader begin
#pragma option push -w-
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Transocr
{
//-- type declarations -------------------------------------------------------
typedef short VBBool;

typedef int *PLongInt;

typedef float *PSingle;

#pragma pack(push, 1)
struct TOCRProcessOptions
{
	int StructId;
	short InvertWholePage;
	short DeskewOff;
	Byte Orientation;
	short NoiseRemoveOff;
	short LineRemoveOff;
	short DeshadeOff;
	short InvertOff;
	short SectioningOn;
	short MergeBreakOff;
	short LineRejectOff;
	short CharacterRejectOff;
	short LexOff;
	short DisableCharacter[256];
} ;
#pragma pack(pop)

struct TOCRJobInfo;
typedef TOCRJobInfo *TpOCRJobInfo;

#pragma pack(push, 1)
struct TOCRJobInfo
{
	int StructId;
	int JobType;
	char *InputFile;
	int PageNo;
	TOCRProcessOptions ProcessOptions;
} ;
#pragma pack(pop)

#pragma pack(push, 1)
struct TOCRResultsHeader
{
	int StructId;
	int XPixelsPerInch;
	int YPixelsPerInch;
	int NumItems;
	float MeanConfidence;
} ;
#pragma pack(pop)

#pragma pack(push, 1)
struct TOCRResultsItem
{
	Word StructId;
	Word OCRCha;
	float Confidence;
	Word XPos;
	Word YPos;
	Word XDim;
	Word YDim;
} ;
#pragma pack(pop)

struct TOCRResults;
typedef TOCRResults *TpOCRResults;

#pragma pack(push, 1)
struct TOCRResults
{
	TOCRResultsHeader Header;
	TOCRResultsItem Items[134217726];
} ;
#pragma pack(pop)

typedef int __stdcall (*TOCRInitialise)(PLongInt JobNo);

typedef int __stdcall (*TOCRShutdown)(int JobNo);

typedef int __stdcall (*TOCRGetErrorMode)(int JobNo, PLongInt ErrorMode);

typedef int __stdcall (*TOCRSetErrorMode)(int JobNo, int ErrorMode);

typedef int __stdcall (*TOCRDoJob)(int JobNo, TpOCRJobInfo JobInfo);

typedef int __stdcall (*TOCRWaitForJob)(int JobNo, PLongInt JobStatus);

typedef int __stdcall (*TOCRWaitForAnyJob)(PLongInt WaitAnyStatus, PLongInt JobNo);

typedef int __stdcall (*TOCRGetJobDBInfo)(PLongInt JobSlotInf);

typedef int __stdcall (*TOCRGetJobStatus)(int JobNo, PLongInt JobStatus);

typedef int __stdcall (*TOCRGetJobStatusEx)(int JobNo, PLongInt JobStatus, PSingle Progress, PLongInt 
	AutoOrientation);

typedef int __stdcall (*TOCRGetJobStatusMsg)(int JobNo, char * Msg);

typedef int __stdcall (*TOCRGetNumPages)(int JobNo, char * Filename, int JobType, PLongInt NumPages)
	;

typedef int __stdcall (*TOCRGetJobResults)(int JobNo, PLongInt ResultsInf, TpOCRResults Results);

typedef int __stdcall (*TOCRGetLicenceInfo)(PLongInt NumberOfJobSlots, PLongInt Volume, PLongInt Time
	, PLongInt Remaining);

typedef int __stdcall (*TOCRConvertTIFFtoDIB)(int JobNo, char * InputFilename, char * OutputFilename
	, int PageNo);

typedef int __stdcall (*TOCRRotateMonoBitmap)(PLongInt hBmp, int Width, int Height, int Orientation)
	;

//-- var, const, procedure ---------------------------------------------------
static const Shortint OCRTrue = 0xffffffff;
static const Shortint OCRFalse = 0x0;
static const Word TOCRJOBMSGLENGTH = 0x200;
static const Shortint TOCRDEFERRORMODE = 0xffffffff;
static const Shortint TOCRERRORMODE_NONE = 0x0;
static const Shortint TOCRERRORMODE_MSGBOX = 0x1;
static const Shortint TOCRSHUTDOWNALL = 0xffffffff;
static const Shortint TOCRJOBSTATUS_ERROR = 0xffffffff;
static const Shortint TOCRJOBSTATUS_BUSY = 0x0;
static const Shortint TOCRJOBSTATUS_DONE = 0x1;
static const Shortint TOCRJOBSTATUS_IDLE = 0x2;
static const Shortint TOCRJOBTYPE_TIFFFILE = 0x0;
static const Shortint TOCRJOBTYPE_DIBFILE = 0x1;
static const Shortint TOCRJOBTYPE_DIBCLIPBOARD = 0x2;
static const Shortint TOCRJOBORIENT_AUTO = 0x0;
static const Byte TOCRJOBORIENT_OFF = 0xff;
static const Shortint TOCRJOBORIENT_90 = 0x1;
static const Shortint TOCRJOBORIENT_180 = 0x2;
static const Shortint TOCRJOBORIENT_270 = 0x3;
static const Shortint TOCRJOBSLOT_FREE = 0x0;
static const Shortint TOCRJOBSLOT_OWNEDBYYOU = 0x1;
static const Shortint TOCRJOBSLOT_BLOCKEDBYYOU = 0x2;
static const Shortint TOCRJOBSLOT_OWNEDBYOTHER = 0xffffffff;
static const Shortint TOCRJOBSLOT_BLOCKEDBYOTHER = 0xfffffffe;
static const Shortint TOCRWAIT_OK = 0x0;
static const Shortint TOCRWAIT_SERVICEABORT = 0x1;
static const Shortint TOCRWAIT_CONNECTIONBROKEN = 0x2;
static const Shortint TOCRWAIT_FAILED = 0xffffffff;
static const Shortint TOCRWAIT_NOJOBSFOUND = 0xfffffffe;
static const Shortint TOCRGETRESULTS_NORESULTS = 0xffffffff;
static const Shortint TOCR_OK = 0x0;
static const Shortint TOCRERR_ILLEGALJOBNO = 0x1;
static const Shortint TOCRERR_FAILLOCKDB = 0x2;
static const Shortint TOCRERR_NOFREEJOBSLOTS = 0x3;
static const Shortint TOCRERR_FAILSTARTSERVICE = 0x4;
static const Shortint TOCRERR_FAILINITSERVICE = 0x5;
static const Shortint TOCRERR_JOBSLOTNOTINIT = 0x6;
static const Shortint TOCRERR_JOBSLOTINUSE = 0x7;
static const Shortint TOCRERR_SERVICEABORT = 0x8;
static const Shortint TOCRERR_CONNECTIONBROKEN = 0x9;
static const Shortint TOCRERR_INVALIDSTRUCTID = 0xa;
static const Shortint TOCRERR_FAILGETVERSION = 0xb;
static const Shortint TOCRERR_FAILLICENCEINF = 0xc;
static const Shortint TOCRERR_LICENCEEXCEEDED = 0xd;
static const Shortint TOCRERR_FAILGETJOBSTATUS1 = 0x14;
static const Shortint TOCRERR_FAILGETJOBSTATUS2 = 0x15;
static const Shortint TOCRERR_FAILGETJOBSTATUS3 = 0x16;
static const Shortint TOCRERR_FAILDOJOB1 = 0x1e;
static const Shortint TOCRERR_FAILDOJOB2 = 0x1f;
static const Shortint TOCRERR_FAILDOJOB3 = 0x20;
static const Shortint TOCRERR_FAILDOJOB4 = 0x21;
static const Shortint TOCRERR_FAILDOJOB5 = 0x22;
static const Shortint TOCRERR_FAILDOJOB6 = 0x23;
static const Shortint TOCRERR_FAILDOJOB7 = 0x24;
static const Shortint TOCRERR_UNKNOWNJOBTYPE1 = 0x28;
static const Shortint TOCRERR_JOBNOTSTARTED1 = 0x29;
static const Shortint TOCRERR_FAILGETJOBSTATUSMSG1 = 0x2d;
static const Shortint TOCRERR_FAILGETJOBSTATUSMSG2 = 0x2e;
static const Shortint TOCRERR_FAILGETNUMPAGES1 = 0x32;
static const Shortint TOCRERR_FAILGETNUMPAGES2 = 0x33;
static const Shortint TOCRERR_FAILGETNUMPAGES3 = 0x34;
static const Shortint TOCRERR_FAILGETNUMPAGES4 = 0x35;
static const Shortint TOCRERR_FAILGETNUMPAGES5 = 0x36;
static const Shortint TOCRERR_FAILGETRESULTS1 = 0x3c;
static const Shortint TOCRERR_FAILGETRESULTS2 = 0x3d;
static const Shortint TOCRERR_FAILGETRESULTS3 = 0x3e;
static const Shortint TOCRERR_FAILGETRESULTS4 = 0x3f;
static const Shortint TOCRERR_FAILALLOCMEM100 = 0x40;
static const Shortint TOCRERR_FAILALLOCMEM101 = 0x41;
static const Shortint TOCRERR_FILENOTSPECIFIED = 0x42;
static const Shortint TOCRERR_FAILROTATEBITMAP = 0x46;
static const Word TOCRERR_INVALIDSERVICESTART = 0x3e8;
static const Word TOCRERR_FAILSERVICEINIT = 0x3e9;
static const Word TOCRERR_FAILLICENCE1 = 0x3ea;
static const Word TOCRERR_FAILSERVICESTART = 0x3eb;
static const Word TOCRERR_UNKNOWNCMD = 0x3ec;
static const Word TOCRERR_FAILREADCOMMAND = 0x3ed;
static const Word TOCRERR_FAILREADOPTIONS = 0x3ee;
static const Word TOCRERR_FAILWRITEJOBSTATUS1 = 0x3ef;
static const Word TOCRERR_FAILWRITEJOBSTATUS2 = 0x3f0;
static const Word TOCRERR_FAILWRITETHREADH = 0x3f1;
static const Word TOCRERR_FAILREADJOBINFO1 = 0x3f2;
static const Word TOCRERR_FAILREADJOBINFO2 = 0x3f3;
static const Word TOCRERR_FAILREADJOBINFO3 = 0x3f4;
static const Word TOCRERR_FAILWRITEPROGRESS = 0x3f5;
static const Word TOCRERR_FAILWRITEJOBSTATUSMSG = 0x3f6;
static const Word TOCRERR_FAILWRITERESULTSSIZE = 0x3f7;
static const Word TOCRERR_FAILWRITERESULTS = 0x3f8;
static const Word TOCRERR_FAILWRITEAUTOORIENT = 0x3f9;
static const Word TOCRERR_FAILLICENCE2 = 0x3fa;
static const Word TOCRERR_FAILLICENCE3 = 0x3fb;
static const Word TOCRERR_TOOMANYCOLUMNS = 0x3fc;
static const Word TOCRERR_TOOMANYROWS = 0x3fd;
static const Word TOCRERR_EXCEEDEDMAXZONE = 0x3fe;
static const Word TOCRERR_NSTACKTOOSMALL = 0x3ff;
static const Word TOCRERR_ALGOERR1 = 0x400;
static const Word TOCRERR_ALGOERR2 = 0x401;
static const Word TOCRERR_EXCEEDEDMAXCP = 0x402;
static const Word TOCRERR_CANTFINDPAGE = 0x403;
static const Word TOCRERR_UNSUPPORTEDIMAGETYPE = 0x404;
static const Word TOCRERR_IMAGETOOWIDE = 0x405;
static const Word TOCRERR_IMAGETOOLONG = 0x406;
static const Word TOCRERR_UNKNOWNJOBTYPE2 = 0x407;
static const Word TOCRERR_TOOWIDETOROT = 0x408;
static const Word TOCRERR_TOOLONGTOROT = 0x409;
static const Word TOCRERR_INVALIDPAGENO = 0x40a;
static const Word TOCRERR_FAILREADJOBTYPENUMBYTES = 0x40b;
static const Word TOCRERR_FAILREADFILENAME = 0x40c;
static const Word TOCRERR_FAILSENDNUMPAGES = 0x40d;
static const Word TOCRERR_FAILOPENCLIP = 0x40e;
static const Word TOCRERR_NODIBONCLIP = 0x40f;
static const Word TOCRERR_FAILREADDIBCLIP = 0x410;
static const Word TOCRERR_FAILLOCKDIBCLIP = 0x411;
static const Word TOCRERR_UNKOWNDIBFORMAT = 0x412;
static const Word TOCRERR_FAILREADDIB = 0x413;
static const Word TOCRERR_NOXYPPM = 0x414;
static const Word TOCRERR_FAILCREATEDIB = 0x415;
static const Word TOCRERR_FAILWRITEDIBCLIP = 0x416;
static const Word TOCRERR_FAILALLOCMEMDIB = 0x417;
static const Word TOCRERR_FAILLOCKMEMDIB = 0x418;
static const Word TOCRERR_FAILCREATEFILE = 0x419;
static const Word TOCRERR_FAILOPENFILE1 = 0x41a;
static const Word TOCRERR_FAILOPENFILE2 = 0x41b;
static const Word TOCRERR_FAILOPENFILE3 = 0x41c;
static const Word TOCRERR_FAILOPENFILE4 = 0x41d;
static const Word TOCRERR_FAILREADFILE1 = 0x41e;
static const Word TOCRERR_FAILREADFILE2 = 0x41f;
static const Word TOCRERR_FAILFINDDATA1 = 0x420;
static const Word TOCRERR_TIFFERROR1 = 0x421;
static const Word TOCRERR_TIFFERROR2 = 0x422;
static const Word TOCRERR_TIFFERROR3 = 0x423;
static const Word TOCRERR_TIFFERROR4 = 0x424;
static const Word TOCRERR_FAILREADFILENAME1 = 0x42e;
static const Word TOCRERR_FAILREADFILENAME2 = 0x42f;
static const Word TOCRERR_FAILREADFILENAME3 = 0x430;
static const Word TOCRERR_FAILREADFILENAME4 = 0x431;
static const Word TOCRERR_FAILREADFILENAME5 = 0x432;
static const Word TOCRERR_FAILALLOCMEM1 = 0x44d;
static const Word TOCRERR_FAILALLOCMEM2 = 0x44e;
static const Word TOCRERR_FAILALLOCMEM3 = 0x44f;
static const Word TOCRERR_FAILALLOCMEM4 = 0x450;
static const Word TOCRERR_FAILALLOCMEM5 = 0x451;
static const Word TOCRERR_FAILALLOCMEM6 = 0x452;
static const Word TOCRERR_FAILALLOCMEM7 = 0x453;
static const Word TOCRERR_FAILALLOCMEM8 = 0x454;
static const Word TOCRERR_FAILALLOCMEM9 = 0x455;
static const Word TOCRERR_FAILALLOCMEM10 = 0x456;
static const Word TOCRERR_BUFFEROVERFLOW1 = 0x7d1;
static const Word TOCRERR_MAPOVERFLOW = 0x7d2;
static const Word TOCRERR_REBREAKNEXTCALL = 0x7d3;
static const Word TOCRERR_REBREAKNEXTDATA = 0x7d4;
static const Word TOCRERR_REBREAKEXACTCALL = 0x7d5;
static const Word TOCRERR_MAXZCANOVERFLOW1 = 0x7d6;
static const Word TOCRERR_MAXZCANOVERFLOW2 = 0x7d7;
static const Word TOCRERR_BUFFEROVERFLOW2 = 0x7d8;
static const Word TOCRERR_NUMKCOVERFLOW = 0x7d9;
static const Word TOCRERR_BUFFEROVERFLOW3 = 0x7da;
static const Word TOCRERR_BUFFEROVERFLOW4 = 0x7db;
static const Word TOCRERR_FCZYREF = 0x7e4;
static const Word TOCRERR_MAXTEXTLINES1 = 0x7e5;
static const Word TOCRERR_LINEINDEX = 0x7e6;
static const Word TOCRERR_MAXFCZSONLINE = 0x7e7;
static const Word TOCRERR_MEMALLOC1 = 0x7e8;
static const Word TOCRERR_MERGEBREAK = 0x7e9;
static const Word TOCRERR_DKERNPRANGE1 = 0x7ee;
static const Word TOCRERR_DKERNPRANGE2 = 0x7ef;
static const Word TOCRERR_BUFFEROVERFLOW5 = 0x7f0;
static const Word TOCRERR_BUFFEROVERFLOW6 = 0x7f1;
static const Word TOCRERR_FILEOPEN1 = 0x7f8;
static const Word TOCRERR_FILEOPEN2 = 0x7f9;
static const Word TOCRERR_FILEOPEN3 = 0x7fa;
static const Word TOCRERR_FILEREAD1 = 0x7fb;
static const Word TOCRERR_FILEREAD2 = 0x7fc;
static const Word TOCRERR_SPWIDZERO = 0x7fd;
static const Word TOCRERR_FAILALLOCMEMLEX1 = 0x7fe;
static const Word TOCRERR_FAILALLOCMEMLEX2 = 0x7ff;
static const Word TOCRERR_BADOBWIDTH = 0x802;
static const Word TOCRERR_BADROTATION = 0x803;
static const Word TOCRERR_MATCHBUFFEROVERFLOW = 0x80c;
static const Word TOCRERR_UIDA = 0x816;
static const Word TOCRERR_UIDB = 0x817;
static const Word TOCRERR_ZEROUID = 0x818;
static const Word TOCRERR_CERTAINTYDBNOTINIT = 0x819;
static const Word TOCRERR_OPENSETTINGS = 0x820;
static const Word TOCRERR_READSETTINGS1 = 0x821;
static const Word TOCRERR_READSETTINGS2 = 0x822;
static const Word TOCRERR_BADSETTINGS = 0x823;
static const Word TOCRERR_WRITESETTINGS = 0x824;
static const Word TOCRERR_MAXSCOREDIFF = 0x825;
static const Word TOCRERR_YDIMREFZERO1 = 0x82a;
static const Word TOCRERR_YDIMREFZERO2 = 0x82b;
static const Word TOCRERR_YDIMREFZERO3 = 0x82c;
static const Word TOCRERR_ASMFILEOPEN = 0x82d;
static const Word TOCRERR_ASMFILEREAD = 0x82e;
static const Word TOCRERR_MEMALLOCASM = 0x82f;
static const Word TOCRERR_MEMREALLOCASM = 0x830;
static const Word TOCRERR_SDBFILEOPEN = 0x831;
static const Word TOCRERR_SDBFILEREAD = 0x832;
static const Word TOCRERR_SDBFILEBAD1 = 0x833;
static const Word TOCRERR_SDBFILEBAD2 = 0x834;
static const Word TOCRERR_MEMALLOCSDB = 0x835;
static const Word TOCRERR_DEVEL1 = 0x836;
static const Word TOCRERR_DEVEL2 = 0x837;
static const Word TOCRERR_DEVEL3 = 0x838;
static const Word TOCRERR_DEVEL4 = 0x839;
static const Word TOCRERR_DEVEL5 = 0x83a;
static const Word TOCRERR_DEVEL6 = 0x83b;
static const Word TOCRERR_DEVEL7 = 0x83c;
static const Word TOCRERR_DEVEL8 = 0x83d;
static const Word TOCRERR_DEVEL9 = 0x83e;
static const Word TOCRERR_DEVEL10 = 0x83f;
static const Word TOCRERR_DEVEL11 = 0x840;
static const Word TOCRERR_DEVEL12 = 0x841;
static const Word TOCRERR_DEVEL13 = 0x842;
static const Word TOCRERR_FILEOPEN4 = 0x843;
static const Word TOCRERR_FILEOPEN5 = 0x844;
static const Word TOCRERR_FILEOPEN6 = 0x845;
static const Word TOCRERR_FILEREAD3 = 0x846;
static const Word TOCRERR_FILEREAD4 = 0x847;
static const Word TOCRERR_MEMALLOCRESULTS = 0x852;
static const Word TOCRERR_MEMALLOCHEAP = 0x85c;
static const Word TOCRERR_HEAPNOTINITIALISED = 0x85d;
static const Word TOCRERR_MEMLIMITHEAP = 0x85e;
static const Word TOCRERR_MEMREALLOCHEAP = 0x85f;
static const Word TOCRERR_MEMALLOCFCZBM = 0x860;
static const Word TOCRERR_FCZBMOVERLAP = 0x861;
static const Word TOCRERR_FCZBMLOCATION = 0x862;
static const Word TOCRERR_MEMREALLOCFCZBM = 0x863;
static const Word TOCRERR_MEMALLOCFCHBM = 0x864;
static const Word TOCRERR_MEMREALLOCFCHBM = 0x865;
extern PACKAGE TOCRInitialise OCRInitialise;
extern PACKAGE TOCRShutdown OCRShutdown;
extern PACKAGE TOCRGetErrorMode OCRGetErrorMode;
extern PACKAGE TOCRSetErrorMode OCRSetErrorMode;
extern PACKAGE TOCRDoJob OCRDoJob;
extern PACKAGE TOCRWaitForJob OCRWaitForJob;
extern PACKAGE TOCRWaitForAnyJob OCRWaitForAnyJob;
extern PACKAGE TOCRGetJobDBInfo OCRGetJobDBInfo;
extern PACKAGE TOCRGetJobStatus OCRGetJobStatus;
extern PACKAGE TOCRGetJobStatusEx OCRGetJobStatusEx;
extern PACKAGE TOCRGetJobStatusMsg OCRGetJobStatusMsg;
extern PACKAGE TOCRGetNumPages OCRGetNumPages;
extern PACKAGE TOCRGetJobResults OCRGetJobResults;
extern PACKAGE TOCRGetLicenceInfo OCRGetLicenseInfo;
extern PACKAGE TOCRConvertTIFFtoDIB OCRConvertTIFFToDIB;
extern PACKAGE TOCRRotateMonoBitmap OCRRotateMonoBitmap;
extern PACKAGE void __fastcall CheckOCRCall(const int ReturnValue);
extern PACKAGE void __fastcall LoadTOCREngine(void);
extern PACKAGE void __fastcall UnloadTOCREngine(void);

}	/* namespace Transocr */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Transocr;
#endif
#pragma option pop	// -w-

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// TransOcr
