/home/rays/src/opensrc/tesseract-ocr/classify/featdefs.h File Reference

#include "ocrfeatures.h"

Go to the source code of this file.

Classes

struct  CHAR_DESC_STRUCT
struct  FEATURE_DEFS_STRUCT

Defines

#define NUM_FEATURE_TYPES   4
#define ILLEGAL_SHORT_NAME   2000

Typedefs

typedef CHAR_DESC_STRUCTCHAR_DESC
typedef FEATURE_DEFS_STRUCTFEATURE_DEFS

Functions

void InitFeatureDefs (FEATURE_DEFS_STRUCT *featuredefs)
void FreeCharDescription (CHAR_DESC CharDesc)
CHAR_DESC NewCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs)
bool ValidCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc)
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

const char * kMicroFeatureType
const char * kCNFeatureType
const char * kIntFeatureType
const char * kGeoFeatureType
const FEATURE_DESC_STRUCT MicroFeatureDesc
const FEATURE_DESC_STRUCT PicoFeatDesc
const FEATURE_DESC_STRUCT CharNormDesc
const FEATURE_DESC_STRUCT OutlineFeatDesc
const FEATURE_DESC_STRUCT IntFeatDesc
const FEATURE_DESC_STRUCT GeoFeatDesc

Define Documentation

#define ILLEGAL_SHORT_NAME   2000
#define NUM_FEATURE_TYPES   4

---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------


Typedef Documentation


Function Documentation

void FreeCharDescription ( CHAR_DESC  CharDesc  ) 

Release the memory consumed by the specified character description and all of the features in that description.

Parameters:
CharDesc character description to be deallocated

Globals:

  • none
Note:
Exceptions: none
History: Wed May 23 13:52:19 1990, DSJ, Created.
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:

  • none
Returns:
New character description structure.
Note:
Exceptions: none
History: Wed May 23 15:27:10 1990, DSJ, Created.
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:

  • none
Parameters:
File open text file to read character description from
Returns:
Character description read from File.
Note:
Exceptions:
  • ILLEGAL_NUM_SETS
History: Wed May 23 17:32:48 1990, DSJ, Created.
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:

  • none
Parameters:
ShortName short name of a feature type
Returns:
Feature type which corresponds to ShortName.
Note:
Exceptions:
  • ILLEGAL_SHORT_NAME
History: Wed May 23 15:36:05 1990, DSJ, Created.
bool ValidCharDescription ( const FEATURE_DEFS_STRUCT FeatureDefs,
CHAR_DESC  CharDesc 
)
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:

  • none
Parameters:
File open text file to write CharDesc to
CharDesc character description to write to File
Note:
Exceptions: none
History: Wed May 23 17:21:18 1990, DSJ, Created.

Variable Documentation

const char* kCNFeatureType
const char* kGeoFeatureType
const char* kIntFeatureType
const char* kMicroFeatureType

---------------------------------------------------------------------------- Global Data Definitions and Declarations ----------------------------------------------------------------------------

Generated on Thu Feb 2 08:19:22 2012 for Tesseract by  doxygen 1.6.3