1 /* rec_baseline.h -- correct stroke coordinates according to inferred baseline
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 REC_BASELINE_H
17 #define REC_BASELINE_H
18 
19 /* need pt_t */
20 #include "stroke.h"
21 
22 #define REC_BASELINE_PRECISION_BITS 8
23 #define REC_BASELINE_HISTORY_MAX 5
24 struct rec_baseline
25 {
26     double orientation;
27     double history[REC_BASELINE_HISTORY_MAX];
28     int correction_matrix[2][2];
29 };
30 typedef struct rec_baseline rec_baseline_t;
31 
32 int rec_baseline_init(rec_baseline_t *baseline);
33 void rec_baseline_deinit(rec_baseline_t *baseline);
34 
35 void rec_baseline_correct(rec_baseline_t *baseline, int *x, int *y);
36 void rec_baseline_nudge(rec_baseline_t *baseline, double correction);
37 
38 #endif
39 
40