All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
featdefs.h
Go to the documentation of this file.
1 /******************************************************************************
2  ** Filename: featdefs.h
3  ** Purpose: Definitions of currently defined feature types.
4  ** Author: Dan Johnson
5  ** History: Mon May 21 08:28:01 1990, DSJ, Created.
6  **
7  ** (c) Copyright Hewlett-Packard Company, 1988.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  ******************************************************************************/
18 #ifndef FEATDEFS_H
19 #define FEATDEFS_H
20 
24 #include "ocrfeatures.h"
25 
26 /* Enumerate the different types of features currently defined. */
27 #define NUM_FEATURE_TYPES 4
28 extern const char* kMicroFeatureType;
29 extern const char* kCNFeatureType;
30 extern const char* kIntFeatureType;
31 extern const char* kGeoFeatureType;
32 
33 /* define error traps which can be triggered by this module.*/
34 #define ILLEGAL_SHORT_NAME 2000
35 
36 /* A character is described by multiple sets of extracted features. Each
37  set contains a number of features of a particular type, for example, a
38  set of bays, or a set of closures, or a set of microfeatures. Each
39  feature consists of a number of parameters. All features within a
40  feature set contain the same number of parameters.*/
41 
45 };
47 
52 };
54 
55 /*----------------------------------------------------------------------
56  Generic functions for manipulating character descriptions
57 ----------------------------------------------------------------------*/
58 void InitFeatureDefs(FEATURE_DEFS_STRUCT *featuredefs);
59 
60 void FreeCharDescription(CHAR_DESC CharDesc);
61 
63 
64 bool ValidCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs,
65  CHAR_DESC CharDesc);
66 
67 void WriteCharDescription(const FEATURE_DEFS_STRUCT& FeatureDefs,
68  CHAR_DESC CharDesc, STRING* str);
69 
71  FILE *File);
72 
73 int ShortNameToFeatureType(const FEATURE_DEFS_STRUCT &FeatureDefs,
74  const char *ShortName);
75 
83 extern const FEATURE_DESC_STRUCT IntFeatDesc;
84 extern const FEATURE_DESC_STRUCT GeoFeatDesc;
85 #endif
void InitFeatureDefs(FEATURE_DEFS_STRUCT *featuredefs)
Definition: featdefs.cpp:121
int ShortNameToFeatureType(const FEATURE_DEFS_STRUCT &FeatureDefs, const char *ShortName)
Definition: featdefs.cpp:302
FEATURE_DEFS_STRUCT * FEATURE_DEFS
Definition: featdefs.h:53
bool ValidCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc)
Definition: featdefs.cpp:219
const char * kGeoFeatureType
Definition: featdefs.cpp:44
const FEATURE_DESC_STRUCT * FeatureDesc[NUM_FEATURE_TYPES]
Definition: featdefs.h:50
FEATURE_SET FeatureSets[NUM_FEATURE_TYPES]
Definition: featdefs.h:44
const FEATURE_DESC_STRUCT PicoFeatDesc
uinT32 NumFeatureSets
Definition: featdefs.h:43
const char * kMicroFeatureType
Definition: featdefs.cpp:41
CHAR_DESC NewCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs)
Definition: featdefs.cpp:164
unsigned int uinT32
Definition: host.h:103
int FeatureEnabled[NUM_FEATURE_TYPES]
Definition: featdefs.h:51
const FEATURE_DESC_STRUCT CharNormDesc
void FreeCharDescription(CHAR_DESC CharDesc)
Definition: featdefs.cpp:141
#define NUM_FEATURE_TYPES
Definition: featdefs.h:27
const FEATURE_DESC_STRUCT IntFeatDesc
CHAR_DESC ReadCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File)
Definition: featdefs.cpp:263
const char * kCNFeatureType
Definition: featdefs.cpp:42
const char * kIntFeatureType
Definition: featdefs.cpp:43
Definition: strngs.h:44
const FEATURE_DESC_STRUCT GeoFeatDesc
void WriteCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc, STRING *str)
Definition: featdefs.cpp:197
const FEATURE_DESC_STRUCT OutlineFeatDesc
CHAR_DESC_STRUCT * CHAR_DESC
Definition: featdefs.h:46
const FEATURE_DESC_STRUCT MicroFeatureDesc
int inT32
Definition: host.h:102
inT32 NumFeatureTypes
Definition: featdefs.h:49