]> git.donarmstrong.com Git - xournal.git/blob - src/xo-shapes.h
77c12fd85835f209beb714db1d3b9c9bf60aeda8
[xournal.git] / src / xo-shapes.h
1 // #define RECOGNIZER_DEBUG  // uncomment for debug output
2
3 #define MAX_POLYGON_SIDES 4
4
5 #define LINE_MAX_DET 0.015   // maximum score for line (ideal line = 0)
6 #define CIRCLE_MIN_DET 0.95 // minimum det. score for circle (ideal circle = 1)
7 #define CIRCLE_MAX_SCORE 0.10 // max circle score for circle (ideal circle = 0)
8
9 #define SLANT_TOLERANCE (5*M_PI/180) // ignore slanting by +/- 5 degrees
10 #define RECTANGLE_ANGLE_TOLERANCE (15*M_PI/180) // angle tolerance in rectangles
11 #define RECTANGLE_LINEAR_TOLERANCE 0.20 // vertex gap tolerance in rectangles
12 #define POLYGON_LINEAR_TOLERANCE 0.20 // vertex gap tolerance in closed polygons
13
14 #define ARROW_MAXSIZE 0.8 // max size of arrow tip relative to main segment
15 #define ARROW_ANGLE_MIN (5*M_PI/180) // arrow tip angles relative to main segment
16 #define ARROW_ANGLE_MAX (50*M_PI/180)
17 #define ARROW_ASYMMETRY_MAX_ANGLE (30*M_PI/180)
18 #define ARROW_ASYMMETRY_MAX_LINEAR 1.0 // size imbalance of two legs of tip
19 #define ARROW_TIP_LINEAR_TOLERANCE 0.30 // gap tolerance on tip segments
20 #define ARROW_SIDEWAYS_GAP_TOLERANCE 0.25 // gap tolerance in lateral direction
21 #define ARROW_MAIN_LINEAR_GAP_MIN -0.3 // gap tolerance on main segment
22 #define ARROW_MAIN_LINEAR_GAP_MAX +0.7 // gap tolerance on main segment
23
24 void recognize_patterns(void);
25 void reset_recognizer(void);