00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FPCHOP_H
00021 #define FPCHOP_H
00022
00023 #include "varable.h"
00024 #include "blobbox.h"
00025 #include "notdll.h"
00026 #include "notdll.h"
00027
00028 class OUTLINE_FRAG:public ELIST_LINK
00029 {
00030 public:
00031 OUTLINE_FRAG() {
00032 }
00033
00034 OUTLINE_FRAG(POLYPT_IT *head_it, POLYPT_IT *tail_it);
00035
00036 OUTLINE_FRAG(OUTLINE_FRAG *head, float tail_y);
00037
00038 POLYPT_LIST polypts;
00039 OUTLINE_FRAG *other_end;
00040 float ycoord;
00041
00042 private:
00043 };
00044
00045 class C_OUTLINE_FRAG:public ELIST_LINK
00046 {
00047 public:
00048 C_OUTLINE_FRAG() {
00049 steps = NULL;
00050 stepcount = 0;
00051 }
00052 ~C_OUTLINE_FRAG () {
00053 if (steps != NULL)
00054 delete [] steps;
00055 }
00056
00057 C_OUTLINE_FRAG(ICOORD start_pt,
00058 ICOORD end_pt,
00059 C_OUTLINE *outline,
00060 inT16 start_index,
00061 inT16 end_index);
00062
00063 C_OUTLINE_FRAG(C_OUTLINE_FRAG *head, inT16 tail_y);
00064 C_OUTLINE *close();
00065 C_OUTLINE_FRAG & operator= (
00066 const C_OUTLINE_FRAG & src);
00067
00068 ICOORD start;
00069 ICOORD end;
00070 DIR128 *steps;
00071 inT32 stepcount;
00072 C_OUTLINE_FRAG *other_end;
00073 inT16 ycoord;
00074
00075 private:
00076 };
00077
00078 ELISTIZEH (OUTLINE_FRAG) ELISTIZEH (C_OUTLINE_FRAG)
00079 extern
00080 INT_VAR_H (textord_fp_chop_error, 2,
00081 "Max allowed bending of chop cells");
00082 extern
00083 double_VAR_H (textord_fp_chop_snap, 0.5,
00084 "Max distance of chop pt from vertex");
00085 ROW *fixed_pitch_words(
00086 TO_ROW *row,
00087 FCOORD rotation
00088 );
00089 WERD *add_repeated_word(
00090 WERD_IT *rep_it,
00091 inT16 &rep_left,
00092 inT16 &prev_chop_coord,
00093 uinT8 &blanks,
00094 float pitch,
00095 WERD_IT *word_it
00096 );
00097 void split_to_blob(
00098 BLOBNBOX *blob,
00099 inT16 chop_coord,
00100 float pitch_error,
00101 OUTLINE_LIST *left_outlines,
00102 C_OUTLINE_LIST *left_coutlines,
00103 OUTLINE_LIST *right_outlines,
00104 C_OUTLINE_LIST *right_coutlines);
00105 void fixed_chop_blob(
00106 PBLOB *blob,
00107 inT16 chop_coord,
00108 float pitch_error,
00109 OUTLINE_LIST *left_outlines,
00110 OUTLINE_LIST *right_outlines
00111 );
00112 void fixed_split_outline(
00113 OUTLINE *srcline,
00114 inT16 chop_coord,
00115 float pitch_error,
00116 OUTLINE_IT *left_it,
00117 OUTLINE_IT *right_it
00118 );
00119 BOOL8 fixed_chop_outline(
00120 OUTLINE *srcline,
00121 inT16 chop_coord,
00122 float pitch_error,
00123 OUTLINE_FRAG_LIST *left_frags,
00124 OUTLINE_FRAG_LIST *right_frags
00125 );
00126 void save_chop_fragment(
00127 POLYPT_IT *head_it,
00128 POLYPT_IT *tail_it,
00129 OUTLINE_FRAG_LIST *frags
00130 );
00131 void add_frag_to_list(
00132 OUTLINE_FRAG *frag,
00133 OUTLINE_FRAG_LIST *frags
00134 );
00135 void insert_chop_pt(
00136 POLYPT_IT *it,
00137 inT16 chop_coord
00138 );
00139 FCOORD find_chop_coords(
00140 POLYPT_IT *it,
00141 inT16 chop_coord
00142 );
00143 void insert_extra_pt(
00144 POLYPT_IT *it
00145 );
00146 void close_chopped_fragments(
00147 OUTLINE_FRAG_LIST *frags,
00148 OUTLINE_LIST *children,
00149 OUTLINE_IT *dest_it
00150 );
00151 void join_chopped_fragments(
00152 OUTLINE_FRAG *bottom,
00153 OUTLINE_FRAG *top
00154 );
00155 void fixed_chop_cblob(
00156 C_BLOB *blob,
00157 inT16 chop_coord,
00158 float pitch_error,
00159 C_OUTLINE_LIST *left_outlines,
00160 C_OUTLINE_LIST *right_outlines
00161 );
00162 void fixed_split_coutline(
00163 C_OUTLINE *srcline,
00164 inT16 chop_coord,
00165 float pitch_error,
00166 C_OUTLINE_IT *left_it,
00167 C_OUTLINE_IT *right_it
00168 );
00169 BOOL8 fixed_chop_coutline(
00170 C_OUTLINE *srcline,
00171 inT16 chop_coord,
00172 float pitch_error,
00173 C_OUTLINE_FRAG_LIST *left_frags,
00174 C_OUTLINE_FRAG_LIST *right_frags
00175 );
00176 inT16 next_anti_left_seg(
00177 C_OUTLINE *srcline,
00178 inT16 tail_index,
00179 inT16 startindex,
00180 inT32 length,
00181 inT16 chop_coord,
00182 float pitch_error,
00183 ICOORD *tail_pos
00184 );
00185 inT16 next_anti_right_seg(
00186 C_OUTLINE *srcline,
00187 inT16 tail_index,
00188 inT16 startindex,
00189 inT32 length,
00190 inT16 chop_coord,
00191 float pitch_error,
00192 ICOORD *tail_pos
00193 );
00194 inT16 next_clock_left_seg(
00195 C_OUTLINE *srcline,
00196 inT16 tail_index,
00197 inT16 startindex,
00198 inT32 length,
00199 inT16 chop_coord,
00200 float pitch_error,
00201 ICOORD *tail_pos
00202 );
00203 inT16 next_clock_right_seg(
00204 C_OUTLINE *srcline,
00205 inT16 tail_index,
00206 inT16 startindex,
00207 inT32 length,
00208 inT16 chop_coord,
00209 float pitch_error,
00210 ICOORD *tail_pos
00211 );
00212 void save_chop_cfragment(
00213 inT16 head_index,
00214 ICOORD head_pos,
00215 inT16 tail_index,
00216 ICOORD tail_pos,
00217 C_OUTLINE *srcline,
00218 C_OUTLINE_FRAG_LIST *frags
00219 );
00220 void add_frag_to_list(
00221 C_OUTLINE_FRAG *frag,
00222 C_OUTLINE_FRAG_LIST *frags
00223 );
00224 void close_chopped_cfragments(
00225 C_OUTLINE_FRAG_LIST *frags,
00226 C_OUTLINE_LIST *children,
00227 float pitch_error,
00228 C_OUTLINE_IT *dest_it
00229 );
00230 C_OUTLINE *join_chopped_fragments(
00231 C_OUTLINE_FRAG *bottom,
00232 C_OUTLINE_FRAG *top
00233 );
00234 void join_segments(
00235 C_OUTLINE_FRAG *bottom,
00236 C_OUTLINE_FRAG *top
00237 );
00238 #endif