Main Page   Compound List   File List   Compound Members   File Members  

gocr_module.h File Reference

This is the module header. More...

#include <stdio.h>
#include "hash.h"
#include "list.h"
#include "unicode.h"
#include "gocr_char.h"

Go to the source code of this file.

Compounds

struct  gocrpixel
struct  gocrimage
struct  gocrblock
struct  gocrline
struct  gocrtextblock
struct  gocrpictureblock
struct  gocrmathblock

Image

#define GOCR_BLACK   0
 Black pixel value. More...

#define GOCR_WHITE   1
 White pixel value. More...

typedef enum gocrimagetype gocrImageType
 Typedef encapsulation.

typedef struct gocrpixel gocrPixel
 Typedef encapsulation.

typedef struct gocrimage gocrImage
 Typedef encapsulation.

enum  gocrimagetype {
  BLACK_AND_WHITE,
  GRAY
}
 Image type values.

void gocr_imageFree ( gocrImage *image )
 Closes an image. More...

gocrImagecurrentimage = NULL
 A pointer to the current image. This variable holds the image being processed right now, and can be freely accessed by the programmer. More...


Block

typedef int gocrblockType
typedef struct gocrblock gocrBlock
 Typedef encapsulation.

typedef struct gocrline gocrLine
typedef struct gocrtextblock gocrTextBlock
typedef struct gocrpictureblock gocrPictureBlock
typedef struct gocrmathblock gocrMathBlock
gocrblockType gocr_blockTypeRegister ( char *name )
 registers a new blockType. More...

gocrblockType gocr_blockTypeGetByName ( char *name )
 returns the blockType given its name string. More...

char* gocr_blockTypeGetNameByType ( gocrblockType t )
 returns the name of the block type given its id. More...

int gocr_blockAdd ( gocrBlock *b )
 adds a block to the block list. More...


Debugging utilities

int gocr_printArea ( gocrImage *image, int x0, int y0, int x1, int y1 )
 prints an image. More...

int gocr_printBlock ( gocrBlock *b )
 prints a block. More...

int gocr_printBox ( gocrBox *b )
 prints a box. More...

int gocr_printBox2 ( gocrBox *b1, gocrBox *b2 )
 prints two boxes. More...


Detailed Description

This is the module header.


Define Documentation

#define GOCR_BLACK   0
 

Black pixel value.

See also:
gocrPixel.

#define GOCR_WHITE   1
 

White pixel value.

See also:
gocrPixel.


Function Documentation

void gocr_imageFree ( gocrImage * image )
 

Closes an image.

This function closes the image, freeing all memory.

Parameters:
image   A pointer to the image structure.

gocrblockType gocr_blockTypeRegister ( char * name )
 

registers a new blockType.

Long description.

Parameters:
name   The new block type name.
Returns:
The blockType id (which is an integer >= 1), or -1 if error.

gocrblockType gocr_blockTypeGetByName ( char * name )
 

returns the blockType given its name string.

Long description.

Parameters:
name   The block type name.
Returns:
The blockType id (which is an integer >= 1), or -1 if not found.

char * gocr_blockTypeGetNameByType ( gocrblockType t )
 

returns the name of the block type given its id.

Long description.

Parameters:
t   The block type id.
Returns:
The name of the block type or NULL if not found.

int gocr_blockAdd ( gocrBlock * b )
 

adds a block to the block list.

Long description.

Parameters:
b   A pointer to the block to be added.
Returns:
0 if OK, or -1 if error.

int gocr_printArea ( gocrImage * image,
int x0,
int y0,
int x1,
int y1 )
 

prints an image.

This function prints an image to the file specified by the ERROR_FILE attribute, formatted according to the PRINT attribute:

  • 0: only data bit (. = WHITE, * = BLACK)
  • 1: marked bits (mark1 + 2*mark2 + 4*mark3)
  • 2: data and marked bits: if white, a...h; if black, A..H
  • 3: only isblock bit (. = is not block, * = is block)
  • 4: only ischar bit (. = is not char, * = is char)
  • 5: complete byte, in hexadecimal
  • 6: complete byte, in ASCII.
Refer to the PostScript documentation for a more detailed description.
Parameters:
new   A pointer to the image.
x0,y0   A vertex of the area to be copied.
x1,y1   The opposite vertex.
See also:
gocr_setAttribute(), gocr_getAttribute(), PS documentation.
Returns:
0 if OK, or -1 if error.

int gocr_printBlock ( gocrBlock * b )
 

prints a block.

This function prints a block to the file specified by the ERROR_FILE attribute. If PRINT_IMAGE attribute is 1 (true), the image of the block will be printed too.

Parameters:
b   A pointer to the block.
See also:
gocr_setAttribute(), gocr_getAttribute(), gocr_printImage.
Returns:
0 if OK, or -1 if error.

int gocr_printBox ( gocrBox * b )
 

prints a box.

This function prints a box to the file specified by the ERROR_FILE attribute. If PRINT_IMAGE attribute is 1 (true), the image of the box will be printed too.

Parameters:
b   A pointer to the box.
See also:
gocr_setAttribute(), gocr_getAttribute(), gocr_printImage.
Returns:
0 if OK, or -1 if error.

int gocr_printBox2 ( gocrBox * b1,
gocrBox * b2 )
 

prints two boxes.

This function prints two boxes side by side, to the file specified by the ERROR_FILE attribute. If PRINT_IMAGE attribute is 1 (true), the image of the boxes will be printed too.

Parameters:
b   A pointer to the box.
See also:
gocr_setAttribute(), gocr_getAttribute(), gocr_printImage.
Returns:
0 if OK, or -1 if error.


Variable Documentation

gocrImage * currentimage = NULL
 

A pointer to the current image. This variable holds the image being processed right now, and can be freely accessed by the programmer.

See also:
gocr_imageLoad(), gocr_imageClose(), gocrImage.


Generated at Thu Mar 1 10:05:33 2001 for GOCR API by doxygen1.2.2 written by Dimitri van Heesch, © 1997-2000