• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* -*-C-*-
2  ********************************************************************************
3  *
4  * File:        chop.h  (Formerly chop.h)
5  * Description:
6  * Author:       Mark Seaman, SW Productivity
7  * Created:      Fri Oct 16 14:37:00 1987
8  * Modified:     Wed Jul 10 14:47:37 1991 (Mark Seaman) marks@hpgrlt
9  * Language:     C
10  * Package:      N/A
11  * Status:       Reusable Software Component
12  *
13  * (c) Copyright 1987, Hewlett-Packard Company.
14  ** Licensed under the Apache License, Version 2.0 (the "License");
15  ** you may not use this file except in compliance with the License.
16  ** You may obtain a copy of the License at
17  ** http://www.apache.org/licenses/LICENSE-2.0
18  ** Unless required by applicable law or agreed to in writing, software
19  ** distributed under the License is distributed on an "AS IS" BASIS,
20  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  ** See the License for the specific language governing permissions and
22  ** limitations under the License.
23  *
24  *******************************************************************************/
25 
26 #ifndef CHOP_H
27 #define CHOP_H
28 
29 /*----------------------------------------------------------------------
30               I n c l u d e s
31 ----------------------------------------------------------------------*/
32 #include "oldheap.h"
33 #include "seam.h"
34 
35 /*----------------------------------------------------------------------
36               T y p e s
37 ---------------------------------------------------------------------*/
38 #define MAX_NUM_POINTS 50
39 typedef HEAP *POINT_GROUP;
40 typedef HEAP *SPLIT_GROUP;
41 
42 /*----------------------------------------------------------------------
43               V a r i a b l e s
44 ----------------------------------------------------------------------*/
45 extern INT_VAR_H(chop_debug, 0, "Chop debug");
46 
47 extern BOOL_VAR_H(chop_enable, 1, "Chop enable");
48 
49 extern BOOL_VAR_H(chop_vertical_creep, 0, "Vertical creep");
50 
51 extern INT_VAR_H(chop_split_length, 10000, "Split Length");
52 
53 extern INT_VAR_H(chop_same_distance, 2, "Same distance");
54 
55 extern INT_VAR_H(chop_min_outline_points, 6,
56                  "Min Number of Points on Outline");
57 
58 extern INT_VAR_H(chop_inside_angle, -50, "Min Inside Angle Bend");
59 
60 extern INT_VAR_H(chop_min_outline_area, 2000, "Min Outline Area");
61 
62 extern double_VAR_H(chop_split_dist_knob, 0.5, "Split length adjustment");
63 
64 extern double_VAR_H(chop_overlap_knob, 0.9, "Split overlap adjustment");
65 
66 extern double_VAR_H(chop_center_knob, 0.15, "Split center adjustment");
67 
68 extern double_VAR_H(chop_sharpness_knob, 0.06, "Split sharpness adjustment");
69 
70 extern double_VAR_H(chop_width_change_knob, 5.0, "Width change adjustment");
71 
72 extern double_VAR_H(chop_ok_split, 100.0, "OK split limit");
73 
74 extern double_VAR_H(chop_good_split, 50.0, "Good split limit");
75 
76 extern INT_VAR_H(chop_x_y_weight, 3, "X / Y  length weight");
77 
78 /*----------------------------------------------------------------------
79               M a c r o s
80 ----------------------------------------------------------------------*/
81 /**********************************************************************
82  * point_bend_angle
83  *
84  * Measure the angle of bend at this edge point. The argument should
85  * be of type EDGEPT.
86  **********************************************************************/
87 #define point_bend_angle(point) \
88 (angle_change ((point)->prev, (point), (point)->next))
89 
90 /*----------------------------------------------------------------------
91               F u n c t i o n s
92 ----------------------------------------------------------------------*/
93 PRIORITY point_priority(EDGEPT *point);
94 
95 void add_point_to_list(POINT_GROUP point_list, EDGEPT *point);
96 
97 int angle_change(EDGEPT *point1, EDGEPT *point2, EDGEPT *point3);
98 
99 int is_little_chunk(EDGEPT *point1, EDGEPT *point2);
100 
101 int is_small_area(EDGEPT *point1, EDGEPT *point2);
102 
103 EDGEPT *pick_close_point(EDGEPT *critical_point,
104                          EDGEPT *vertical_point,
105                          int *best_dist);
106 
107 void prioritize_points(TESSLINE *outline, POINT_GROUP points);
108 
109 void new_min_point(EDGEPT *local_min, POINT_GROUP points);
110 
111 void new_max_point(EDGEPT *local_max, POINT_GROUP points);
112 
113 void vertical_projection_point(EDGEPT *split_point, EDGEPT *target_point,
114                                EDGEPT** best_point);
115 
116 #endif
117