1 /************************************************************************** 2 ** Licensed under the Apache License, Version 2.0 (the "License"); 3 ** you may not use this file except in compliance with the License. 4 ** You may obtain a copy of the License at 5 ** http://www.apache.org/licenses/LICENSE-2.0 6 ** Unless required by applicable law or agreed to in writing, software 7 ** distributed under the License is distributed on an "AS IS" BASIS, 8 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 ** See the License for the specific language governing permissions and 10 ** limitations under the License. 11 **************************************************************************/ 12 13 #ifndef CONST_H 14 #define CONST_H 15 16 /*This file contains constants which are global to the entire system*/ 17 18 #define PATHSIZE 8192 /*max elements in edge path */ 19 #define OUTLINESIZE 256 /*max elements in aprroximated path */ 20 #define BLOBSIZE 10000 /*max no of blobs on a page */ 21 22 #if 0 23 #define FIRSTCHAR '!' /*first char in set */ 24 #define LASTCHAR '~' /*last char in set */ 25 #define CHARSETSIZE (LASTCHAR-FIRSTCHAR+1) 26 no of chars in set 27 #define MERGESIZE 10 /*max chars in a class */ 28 #define MAXCHARSIZE 159 /*max size of any char */ 29 #define CLASSIZE 256 /*max no of classes */ 30 #define SPLITSIZE 4 /*no of to_classes per class */ 31 #define BADCLASS 255 /*null class */ 32 #define BADMATCH 255 /*no match */ 33 #define CLASSLENGTH 16 /*max chars in a class string */ 34 #endif 35 36 #define VECSCALE 3 /*vector scaling factor in fx */ 37 #define REALSCALE ((double)(1<<VECSCALE)) 38 /*2.0**VECSCALE */ 39 #define SPLINESIZE 23 /*max spline parts to a line */ 40 41 #ifndef NULL 42 #define NULL 0 /*null pointer array index */ 43 #endif 44 45 #define MAXUCHAR 255 /*max value of unsigned char */ 46 #define PI 3.14159265359/*pi */ 47 #ifndef __UNIX__ 48 /*approximate!! */ 49 #define MAXFLOAT 2000000000.0f 50 #endif 51 52 #define FILENAMESIZE 1024 /*max permissible path name length */ 53 54 #define MAX_WO_CLASSES 3 /*no of quickie classes */ 55 //#define BLOBFLAGS 4 /*No of flags in a blob*/ 56 #define ITALIC 0 /*measure of italicness */ 57 #define ASPECT_RATIO 2 /*aspect ratio of blob */ 58 59 #define NODEFLAGS 4 /*no of flags in a node */ 60 61 #define EDGEPTFLAGS 4 /*concavity,length etc. */ 62 #define FLAGS 0 /*flags array indices */ 63 #define CONVEX 1 /*TESSLINE point is convex */ 64 #define CONCAVE 2 /*used and set only in edges */ 65 //#define FIXED 4 /*TESSLINE point is fixed*/ 66 #define ONHULL 8 /*on convex hull */ 67 68 #define RUNLENGTH 1 /*length of run */ 69 70 #define DIR 2 /*direction of run */ 71 72 #define CORRECTION 3 /*correction of run */ 73 74 #define OUTLINES_PER_BLOB 8 /*max no of outlines in blob */ 75 76 #define PLUS 1 /*starbase markers */ 77 #define CIRCLE 3 78 79 //#define WHITE 1 /*starbase colours*/ 80 //#define RED 2 81 //#define YELLOW 3 82 //#define GREEN 4 83 //#define CYAN 5 84 //#define BLUE 6 85 86 #define SMD 0x100000 /*memory driver output */ 87 88 #define SCAN 0 /*scanner process id */ 89 #define EDGE 1 /*edge process id */ 90 #define FX 2 /*fx process id */ 91 #define TESSTO 3 /*pageseg process id */ 92 #define OCR 4 /*ocr process id */ 93 #define MAXPROC (OCR+1) /*no of processes */ 94 95 /*debugs[OCR] control flags*/ 96 #define STRINGCMPS 0x1 /*show ocrdiff compares */ 97 98 /*acts[OCR] control flags*/ 99 #define CHECKS 0x1 /*run accuracy checks */ 100 #define WRITEERRORS 0x2 /*write error output */ 101 #define WRITECORRECTS 0x4 /*write correct blobs as errors */ 102 #define WRITEWERDS 0x8 /*write whole words */ 103 #define FXSELECT 0x10 /*write error output */ 104 #define WRITEROWFILE 0x06 /*any write errors */ 105 #define LEARN 0x100 /*learn mode */ 106 #define WRITELEARNFILE 0xf00 /*any learning */ 107 #define EACHWERD 0x2000 /*clear vdc after each word */ 108 #endif 109