Tesseract 3.01
|
#include "featdefs.h"
#include "emalloc.h"
#include "danerror.h"
#include "scanutils.h"
#include <string.h>
#include <stdio.h>
Defines | |
#define | ILLEGAL_NUM_SETS 3001 |
#define | PICO_FEATURE_LENGTH 0.05 |
#define | MAX_OUTLINE_FEATURES 100 |
Functions | |
StartParamDesc (MicroFeatureParams) DefineParam(0 | |
DefineParam (0, 0,-0.25, 0.75) DefineParam(0 | |
DefineParam (1, 0, 0.0, 1.0) DefineParam(0 | |
DefineParam (0, 1,-0.5, 0.5) EndParamDescDefineFeature(MicroFeatureDesc | |
StartParamDesc (PicoFeatParams) DefineParam(0 | |
EndParamDesc | DefineFeature (PicoFeatDesc, 2, 1, 1, MAX_UINT8,"Pico","pf", PicoFeatParams) StartParamDesc(CharNormParams) DefineParam(0 |
EndParamDesc | DefineParam (0, 1, 0.0, 1.0) DefineParam(0 |
EndParamDesc | DefineParam (0, 0, 0.0, 1.0) EndParamDescDefineFeature(CharNormDesc |
EndParamDesc CharNormParams | StartParamDesc (OutlineFeatParams) DefineParam(0 |
void | InitFeatureDefs (FEATURE_DEFS_STRUCT *featuredefs) |
void | FreeCharDescription (CHAR_DESC CharDesc) |
CHAR_DESC | NewCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs) |
void | WriteCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File, CHAR_DESC CharDesc) |
CHAR_DESC | ReadCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File) |
int | ShortNameToFeatureType (const FEATURE_DEFS_STRUCT &FeatureDefs, const char *ShortName) |
Variables | |
Micro | |
mf | |
MicroFeatureParams FLOAT32 | PicoFeatureLength = PICO_FEATURE_LENGTH |
EndParamDesc | CharNorm |
EndParamDesc | cn |
EndParamDesc CharNormParams | MAX_OUTLINE_FEATURES |
EndParamDesc CharNormParams | Outline |
EndParamDesc CharNormParams | of |
#define ILLEGAL_NUM_SETS 3001 |
define errors triggered by this module
#define MAX_OUTLINE_FEATURES 100 |
#define PICO_FEATURE_LENGTH 0.05 |
EndParamDesc DefineFeature | ( | PicoFeatDesc | , |
2 | , | ||
1 | , | ||
1 | , | ||
MAX_UINT8 | , | ||
"Pico" | , | ||
"pf" | , | ||
PicoFeatParams | |||
) |
DefineParam | ( | 0 | , |
1 | , | ||
-0. | 5, | ||
0. | 5 | ||
) |
EndParamDesc DefineParam | ( | 0 | , |
0 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
EndParamDesc CharNormParams DefineParam | ( | 0 | , |
0 | , | ||
-0. | 25, | ||
0. | 75 | ||
) |
EndParamDesc CharNormParams DefineParam | ( | 1 | , |
0 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
EndParamDesc DefineParam | ( | 0 | , |
1 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
void FreeCharDescription | ( | CHAR_DESC | CharDesc | ) |
Release the memory consumed by the specified character description and all of the features in that description.
CharDesc | character description to be deallocated |
Globals:
void InitFeatureDefs | ( | FEATURE_DEFS_STRUCT * | featuredefs | ) |
CHAR_DESC NewCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs | ) |
Allocate a new character description, initialize its feature sets to be empty, and return it.
Globals:
CHAR_DESC ReadCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
FILE * | File | ||
) |
Read a character description from File, and return a data structure containing this information. The data is formatted as follows:
NumberOfSets ShortNameForSet1 Set1 ShortNameForSet2 Set2 ...
Globals:
File | open text file to read character description from |
int ShortNameToFeatureType | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
const char * | ShortName | ||
) |
Search thru all features currently defined and return the feature type for the feature with the specified short name. Trap an error if the specified name is not found.
Globals:
ShortName | short name of a feature type |
StartParamDesc | ( | PicoFeatParams | ) |
EndParamDesc CharNormParams StartParamDesc | ( | OutlineFeatParams | ) |
StartParamDesc | ( | MicroFeatureParams | ) |
void WriteCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
FILE * | File, | ||
CHAR_DESC | CharDesc | ||
) |
Write a textual representation of CharDesc to File. The format used is to write out the number of feature sets which will be written followed by a representation of each feature set.
Each set starts with the short name for that feature followed by a description of the feature set. Feature sets which are not present are not written.
Globals:
File | open text file to write CharDesc to |
CharDesc | character description to write to File |
EndParamDesc CharNorm |
EndParamDesc cn |
EndParamDesc CharNormParams MAX_OUTLINE_FEATURES |
EndParamDesc CharNormParams of |
EndParamDesc CharNormParams Outline |
MicroFeatureParams FLOAT32 PicoFeatureLength = PICO_FEATURE_LENGTH |
---------------------------------------------------------------------------- Global Data Definitions and Declarations ----------------------------------------------------------------------------