1 /* feature.h -- recognizer engine-specific feature data 2 3 Copyright 2001 Carl Worth 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 */ 15 16 #ifndef FEATURE_H 17 #define FEATURE_H 18 19 #include "rec.h" 20 #include "rec_engine.h" 21 22 struct rec; 23 struct feature 24 { 25 rec_engine_t *engine; 26 void *data; 27 }; 28 typedef struct feature feature_t; 29 30 struct feature_list 31 { 32 int num_features; 33 feature_t *features; 34 }; 35 typedef struct feature_list feature_list_t; 36 37 int feature_init(feature_t *feature, struct rec *rec, char *engine_name, char *data_str); 38 void feature_deinit(feature_t *feature); 39 40 double feature_recognize(feature_t *feature, stroke_t *stroke); 41 42 int feature_list_init(feature_list_t *list); 43 void feature_list_deinit(feature_list_t *list); 44 int feature_list_append(feature_list_t *list, feature_t *feature); 45 46 #endif 47