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 "params.h"
00024 #include "blobbox.h"
00025 #include "notdll.h"
00026 #include "notdll.h"
00027
00028 class C_OUTLINE_FRAG:public ELIST_LINK
00029 {
00030 public:
00031 C_OUTLINE_FRAG() {
00032 steps = NULL;
00033 stepcount = 0;
00034 }
00035 ~C_OUTLINE_FRAG () {
00036 if (steps != NULL)
00037 delete [] steps;
00038 }
00039
00040 C_OUTLINE_FRAG(ICOORD start_pt,
00041 ICOORD end_pt,
00042 C_OUTLINE *outline,
00043 inT16 start_index,
00044 inT16 end_index);
00045
00046 C_OUTLINE_FRAG(C_OUTLINE_FRAG *head, inT16 tail_y);
00047 C_OUTLINE *close();
00048 C_OUTLINE_FRAG & operator= (
00049 const C_OUTLINE_FRAG & src);
00050
00051 ICOORD start;
00052 ICOORD end;
00053 DIR128 *steps;
00054 inT32 stepcount;
00055 C_OUTLINE_FRAG *other_end;
00056 inT16 ycoord;
00057
00058 private:
00059 };
00060
00061 ELISTIZEH(C_OUTLINE_FRAG)
00062
00063 extern
00064 INT_VAR_H (textord_fp_chop_error, 2,
00065 "Max allowed bending of chop cells");
00066 extern
00067 double_VAR_H (textord_fp_chop_snap, 0.5,
00068 "Max distance of chop pt from vertex");
00069 ROW *fixed_pitch_words(
00070 TO_ROW *row,
00071 FCOORD rotation
00072 );
00073 WERD *add_repeated_word(
00074 WERD_IT *rep_it,
00075 inT16 &rep_left,
00076 inT16 &prev_chop_coord,
00077 uinT8 &blanks,
00078 float pitch,
00079 WERD_IT *word_it
00080 );
00081 void split_to_blob(
00082 BLOBNBOX *blob,
00083 inT16 chop_coord,
00084 float pitch_error,
00085 C_OUTLINE_LIST *left_coutlines,
00086 C_OUTLINE_LIST *right_coutlines);
00087 void fixed_chop_cblob(
00088 C_BLOB *blob,
00089 inT16 chop_coord,
00090 float pitch_error,
00091 C_OUTLINE_LIST *left_outlines,
00092 C_OUTLINE_LIST *right_outlines
00093 );
00094 void fixed_split_coutline(
00095 C_OUTLINE *srcline,
00096 inT16 chop_coord,
00097 float pitch_error,
00098 C_OUTLINE_IT *left_it,
00099 C_OUTLINE_IT *right_it
00100 );
00101 BOOL8 fixed_chop_coutline(
00102 C_OUTLINE *srcline,
00103 inT16 chop_coord,
00104 float pitch_error,
00105 C_OUTLINE_FRAG_LIST *left_frags,
00106 C_OUTLINE_FRAG_LIST *right_frags
00107 );
00108 inT16 next_anti_left_seg(
00109 C_OUTLINE *srcline,
00110 inT16 tail_index,
00111 inT16 startindex,
00112 inT32 length,
00113 inT16 chop_coord,
00114 float pitch_error,
00115 ICOORD *tail_pos
00116 );
00117 inT16 next_anti_right_seg(
00118 C_OUTLINE *srcline,
00119 inT16 tail_index,
00120 inT16 startindex,
00121 inT32 length,
00122 inT16 chop_coord,
00123 float pitch_error,
00124 ICOORD *tail_pos
00125 );
00126 inT16 next_clock_left_seg(
00127 C_OUTLINE *srcline,
00128 inT16 tail_index,
00129 inT16 startindex,
00130 inT32 length,
00131 inT16 chop_coord,
00132 float pitch_error,
00133 ICOORD *tail_pos
00134 );
00135 inT16 next_clock_right_seg(
00136 C_OUTLINE *srcline,
00137 inT16 tail_index,
00138 inT16 startindex,
00139 inT32 length,
00140 inT16 chop_coord,
00141 float pitch_error,
00142 ICOORD *tail_pos
00143 );
00144 void save_chop_cfragment(
00145 inT16 head_index,
00146 ICOORD head_pos,
00147 inT16 tail_index,
00148 ICOORD tail_pos,
00149 C_OUTLINE *srcline,
00150 C_OUTLINE_FRAG_LIST *frags
00151 );
00152 void add_frag_to_list(
00153 C_OUTLINE_FRAG *frag,
00154 C_OUTLINE_FRAG_LIST *frags
00155 );
00156 void close_chopped_cfragments(
00157 C_OUTLINE_FRAG_LIST *frags,
00158 C_OUTLINE_LIST *children,
00159 float pitch_error,
00160 C_OUTLINE_IT *dest_it
00161 );
00162 C_OUTLINE *join_chopped_fragments(
00163 C_OUTLINE_FRAG *bottom,
00164 C_OUTLINE_FRAG *top
00165 );
00166 void join_segments(
00167 C_OUTLINE_FRAG *bottom,
00168 C_OUTLINE_FRAG *top
00169 );
00170 #endif