Main Page | Class List | Directories | File List | Class Members | File Members

gocr_char.h File Reference

This is the character header. More...

Go to the source code of this file.

Classes

struct  gocr_char
 This is the character structure. More...
struct  gocr_box
 This is the box structure. More...

charFinder functions

#define GOCR_SET   1
#define GOCR_UNSET   0
int gocr_charBegin (void)
 inits a new character structure.
int gocr_charEnd (void)
 closes a new character structure.
int gocr_charSetAllNearPixels (int action, int x, int y, int connect)
int gocr_charSetAttribute (int action, char *name,...)
 set/unset a character attribute
int gocr_charSetPixel (int action, int x, int y)
 set/unset a pixel.
int gocr_charSetRect (int action, int x0, int y0, int x1, int y1)
 set/unset all pixels in a rectangle.

Character

typedef gocr_char gocr_Char
 Typedef encapsulation.
typedef gocr_box gocr_Box
 Typedef encapsulation.
typedef enum gocr_charattributetype gocr_CharAttributeType
 Typedef encapsulation.
enum  gocr_charattributetype { SETTABLE, UNTIL_OVERRIDEN }

charRecog functions

int gocr_charAttributeRegister (char *name, gocr_CharAttributeType t, char *format)
 Register a character attribute.
int gocr_charAttributeInsert (char *name,...)
int gocr_boxCharSet (gocr_Box *b, wchar_t w, float prob)
 Sets a possible character to a box.


Detailed Description

This is the character header.

Author:
Bruno Barberi Gnecco <brunobg@sourceforge.net>

Function Documentation

int gocr_charBegin void   ) 
 

inits a new character structure.

Long description.

Attention:
Do not change the value of the CHAR_OVERLAP attribute between a gocr_charBegin/End pair, or unpredictable behaviour may occur.
See also:
gocr_charEnd, gocr_charSetAttribute, gocr_charSetPixel, gocr_charSetRect.
Return values:
0 OK
-1 error.

int gocr_charEnd void   ) 
 

closes a new character structure.

Long description; adds to the character list.

See also:
gocr_charBegin.
Return values:
0 OK
-1 error.

int gocr_charSetAttribute int  action,
char *  name,
  ...
 

set/unset a character attribute

Long description. attribute must be registered. Function prototype not stable yet. Currently (deliberatedly) not working. See gocr_boxAttributeSet.

Parameters:
action Either GOCR_SET or GOCR_UNSET.
name Attribute name.
... Data.
See also:
gocr_charBegin, gocr_charEnd, gocr_charSetAllNearPixels, gocr_charSetPixel, gocr_charSetRect.
Return values:
0 OK
-1 error.

int gocr_charSetPixel int  action,
int  x,
int  y
 

set/unset a pixel.

This functions selects or unselects a pixel.

Parameters:
action Either GOCR_SET or GOCR_UNSET.
x The x coordinate of the pixel.
y The y coordinate of the pixel.
See also:
gocr_charBegin, gocr_charEnd, gocr_charSetAttribute, gocr_charSetPixel, gocr_charSetRect.
Return values:
0 OK
-1 error.

int gocr_charSetRect int  action,
int  x0,
int  y0,
int  x1,
int  y1
 

set/unset all pixels in a rectangle.

This function allows you to select or unselect all pixels in a rectangle defined by two opposite vertices. The rectangle must be entirely in the image. The boundaries of the rectangle are considered to be part of it: a rectangle defined by (1,1), (1,1) vertices is the point (1,1).

If the CHAR_OVERLAP flag is false, and you are creating a new character (i.e., used gocr_charBegin and not gocr_charSplitBegin) it automatically selects only those pixels which are not already part of another character.

Parameters:
action Either GOCR_SET or GOCR_UNSET.
x0,y0 A vertex (x0, y0) of the rectangle.
x1,y1 The opposite vertex (x1, y1).
See also:
gocr_charBegin, gocr_charEnd, gocr_charSetAttribute, gocr_charSetPixel, gocr_charSetRect.
Return values:
0 OK
-1 error.

int gocr_charAttributeRegister char *  name,
gocr_CharAttributeType  t,
char *  format
 

Register a character attribute.

This functions registers a certain attribute... Long description.

Parameters:
name The attribute name.
t The attribute type, which is either SETTABLE or UNTIL_OVERRIDEN.
format A printf-like string with the attribute format.
Return values:
0 OK
-1 error.

int gocr_boxCharSet gocr_Box b,
wchar_t  w,
float  prob
 

Sets a possible character to a box.

Long description.

Parameters:
w The character.
prob The probability (0.0<=p<=1.0)
Return values:
0 OK
-1 error.


Generated on Tue Oct 25 04:13:04 2005 for GOCR API by  doxygen 1.4.4