00001 /************************************************************************** 00002 ** Licensed under the Apache License, Version 2.0 (the "License"); 00003 ** you may not use this file except in compliance with the License. 00004 ** You may obtain a copy of the License at 00005 ** http://www.apache.org/licenses/LICENSE-2.0 00006 ** Unless required by applicable law or agreed to in writing, software 00007 ** distributed under the License is distributed on an "AS IS" BASIS, 00008 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00009 ** See the License for the specific language governing permissions and 00010 ** limitations under the License. 00011 **************************************************************************/ 00012 00013 #ifndef CONST_H 00014 #define CONST_H 00015 00016 /*This file contains constants which are global to the entire system*/ 00017 00018 #define PATHSIZE 8192 /*max elements in edge path */ 00019 #define OUTLINESIZE 256 /*max elements in aprroximated path */ 00020 #define BLOBSIZE 10000 /*max no of blobs on a page */ 00021 00022 #if 0 00023 #define FIRSTCHAR '!' /*first char in set */ 00024 #define LASTCHAR '~' /*last char in set */ 00025 #define CHARSETSIZE (LASTCHAR-FIRSTCHAR+1) 00026 no of chars in set 00027 #define MERGESIZE 10 /*max chars in a class */ 00028 #define MAXCHARSIZE 159 /*max size of any char */ 00029 #define CLASSIZE 256 /*max no of classes */ 00030 #define SPLITSIZE 4 /*no of to_classes per class */ 00031 #define BADCLASS 255 /*null class */ 00032 #define BADMATCH 255 /*no match */ 00033 #define CLASSLENGTH 16 /*max chars in a class string */ 00034 #endif 00035 00036 #define VECSCALE 3 /*vector scaling factor in fx */ 00037 #define REALSCALE ((double)(1<<VECSCALE)) 00038 /*2.0**VECSCALE */ 00039 #define SPLINESIZE 23 /*max spline parts to a line */ 00040 00041 #ifndef NULL 00042 #define NULL 0 /*null pointer array index */ 00043 #endif 00044 00045 #define MAXUCHAR 255 /*max value of unsigned char */ 00046 #define PI 3.14159265359/*pi */ 00047 #ifndef __UNIX__ 00048 /*approximate!! */ 00049 #define MAXFLOAT 2000000000.0f 00050 #endif 00051 00052 #define FILENAMESIZE 1024 /*max permissible path name length */ 00053 00054 #define MAX_WO_CLASSES 3 /*no of quickie classes */ 00055 //#define BLOBFLAGS 4 /*No of flags in a blob*/ 00056 #define ITALIC 0 /*measure of italicness */ 00057 #define ASPECT_RATIO 2 /*aspect ratio of blob */ 00058 00059 #define NODEFLAGS 4 /*no of flags in a node */ 00060 00061 #define EDGEPTFLAGS 4 /*concavity,length etc. */ 00062 #define FLAGS 0 /*flags array indices */ 00063 #define CONVEX 1 /*TESSLINE point is convex */ 00064 #define CONCAVE 2 /*used and set only in edges */ 00065 //#define FIXED 4 /*TESSLINE point is fixed*/ 00066 #define ONHULL 8 /*on convex hull */ 00067 00068 #define RUNLENGTH 1 /*length of run */ 00069 00070 #define DIR 2 /*direction of run */ 00071 00072 #define CORRECTION 3 /*correction of run */ 00073 00074 #define OUTLINES_PER_BLOB 8 /*max no of outlines in blob */ 00075 00076 #define PLUS 1 /*starbase markers */ 00077 #define CIRCLE 3 00078 00079 //#define WHITE 1 /*starbase colours*/ 00080 //#define RED 2 00081 //#define YELLOW 3 00082 //#define GREEN 4 00083 //#define CYAN 5 00084 //#define BLUE 6 00085 00086 #define SMD 0x100000 /*memory driver output */ 00087 00088 #define SCAN 0 /*scanner process id */ 00089 #define EDGE 1 /*edge process id */ 00090 #define FX 2 /*fx process id */ 00091 #define TESSTO 3 /*pageseg process id */ 00092 #define OCR 4 /*ocr process id */ 00093 #define MAXPROC (OCR+1) /*no of processes */ 00094 00095 /*debugs[OCR] control flags*/ 00096 #define STRINGCMPS 0x1 /*show ocrdiff compares */ 00097 00098 /*acts[OCR] control flags*/ 00099 #define CHECKS 0x1 /*run accuracy checks */ 00100 #define WRITEERRORS 0x2 /*write error output */ 00101 #define WRITECORRECTS 0x4 /*write correct blobs as errors */ 00102 #define WRITEWERDS 0x8 /*write whole words */ 00103 #define FXSELECT 0x10 /*write error output */ 00104 #define WRITEROWFILE 0x06 /*any write errors */ 00105 #define LEARN 0x100 /*learn mode */ 00106 #define WRITELEARNFILE 0xf00 /*any learning */ 00107 #define EACHWERD 0x2000 /*clear vdc after each word */ 00108 #endif