]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/services/gfx/mw/v2_0/src/demos/nxscribble/li_recognizer_internal.h
Initial revision
[karo-tx-redboot.git] / packages / services / gfx / mw / v2_0 / src / demos / nxscribble / li_recognizer_internal.h
1 /*
2  *  li_recognizer_internal.h
3  *
4  *  Adapted from cmu_recognizer_internal.h.
5  *  Credit to Dean Rubine, Jim Kempf, and Ari Rapkin.
6  */
7
8 #ifndef _LI_RECOGNIZER_INTERNAL_H_
9
10 #define _LI_RECOGNIZER_INTERNAL_H_
11
12 #include <hre_internal.h>
13 #include "sc.h"
14
15 typedef struct PointList {
16     int npts;
17     int xrange, yrange;
18     pen_point* pts;
19     struct PointList* next;
20 } point_list;
21
22 typedef struct {
23     char* file_name;              /*The classifier file name.*/
24     sClassifier sc;               /*The classifier.*/
25     point_list* ex[MAXSCLASSES];   /*The training examples.*/
26     char* cnames[MAXSCLASSES];    /*The class names.*/
27     point_list* canonex[MAXSCLASSES];   /* Canonicalized versions of the strokes. */
28     point_list* dompts[MAXSCLASSES];    /* Dominant points */
29 } rClassifier;
30
31
32 /*This structure contains extra fields for instance-specific data.*/
33
34 typedef struct {
35     /*Instance-specific data.*/
36     u_int li_magic;            /*Just to make sure nobody's cheating.*/
37     rClassifier li_rc;         /*The character classifier.*/
38 } li_recognizer;
39
40
41 /*Name of the default classifier file.*/
42 #define LI_DEFAULT_CLASSIFIER_FILE   "default.cl"
43
44 /*Classifier file extension.*/
45 #define LI_CLASSIFIER_EXTENSION ".cl"
46
47 /*Locale supported by recognizer.*/
48 #define LI_SUPPORTED_LOCALE  REC_DEFAULT_LOCALE
49 #endif