1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
/*
GOCR Copyright (C) 2000 Joerg Schulenburg Joerg.Schulenburg@physik.uni-magdeburg.de
GOCR API Copyright (C) 2001 Bruno Barberi Gnecco <brunobg@sourceforge.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GOCR_CHAR_H
#define _GOCR_CHAR_H
#ifndef _GOCR_MODULE_H
# error "Do not call gocr_gui.h directly; call gocr_module.h instead."
#endif.
#ifdef __cplusplus
extern "C" {
#endif
/*! \file gocr_char.h
\brief This is the character header
\author Bruno Barberi Gnecco <brunobg@sourceforge.net>
*/
/*
* character frame
*/
/** @name Character
*/
/*@{*/
/**
\brief This is the character structure.
\sa gocr_Box.
*/
struct gocr_char {
wchar_t c; /**< character */
float prob; /**< probability */
};
/**
\brief Typedef encapsulation.
*/
typedef struct gocr_char gocr_Char;
/**
\brief This is the box structure.
*/
struct gocr_box {
int x0, y0, x1, y1; /**< frame (relative to block) */
wchar_t *attributes; /**< character attributes */
gocr_Image *image; /**< shared image */
List possible; /**< list of possible chars */
gocr_Char *ch; /**< pointer to chosen char */
wchar_t modifier; /**< default=0, see compose() in unicode.c */
/* provided for compatibility only, deprecated. */
wchar_t c, ac; /**< detected (alternate) */
int num; /**< same nummer = same char */
int x, y, dots; /**< reference-pixel, i-dots */
};
/**
\brief Typedef encapsulation.
*/
typedef struct gocr_box gocr_Box;
enum gocr_charattributetype {
SETTABLE, UNTIL_OVERRIDEN
};
/**
\brief Typedef encapsulation.
*/
typedef enum gocr_charattributetype gocr_CharAttributeType;
/*@}*/
/*
* charFinder functions
*/
/** @name charFinder functions
*/
/*@{*/
#define GOCR_SET 1
#define GOCR_UNSET 0
extern int gocr_charBegin ( void );
extern int gocr_charEnd ( void );
extern int gocr_charSetAllNearPixels ( int action, int x, int y , int connect );
extern int gocr_charSetAttribute ( int action, char *name, ... );
extern int gocr_charSetPixel ( int action, int x, int y );
extern int gocr_charSetRect ( int action, int x0, int y0, int x1, int y1 );
/*@}*/
/*
* charRecog functions
*/
/** @name charRecog functions
*/
/*@{*/
extern int gocr_charAttributeRegister ( char *name, gocr_CharAttributeType t,
char *format );
extern int gocr_charAttributeInsert ( char *name, ... );
extern int gocr_boxCharSet( gocr_Box *b, wchar_t w, float prob );
/*@}*/
#ifdef __cplusplus
}
#endif
#endif
|