textord/fpchop.h

Go to the documentation of this file.
00001 
00019 #ifndef           FPCHOP_H
00020 #define           FPCHOP_H
00021 
00022 #include          "varable.h"
00023 #include          "blobbox.h"
00024 #include          "notdll.h"
00025 #include          "notdll.h"
00026 
00031 class OUTLINE_FRAG:public ELIST_LINK
00032 {
00033   public:
00034     OUTLINE_FRAG() { 
00035     }                            //empty constructor
00036                                  //head of fragment
00037     OUTLINE_FRAG(POLYPT_IT *head_it, POLYPT_IT *tail_it);  //tail of fragment
00038                                  //other end
00039     OUTLINE_FRAG(OUTLINE_FRAG *head, float tail_y); 
00040 
00041     POLYPT_LIST polypts;         //only if a head
00042     OUTLINE_FRAG *other_end;     //head if a tail
00043     float ycoord;                //coord of cut pt
00044 
00045   private:
00046 };
00047 
00052 class C_OUTLINE_FRAG:public ELIST_LINK
00053 {
00054   public:
00055     C_OUTLINE_FRAG() {  //empty constructor
00056       steps = NULL;
00057       stepcount = 0;
00058     }
00059     ~C_OUTLINE_FRAG () {
00060       if (steps != NULL)
00061         delete [] steps; 
00062     }
00063                                  //start coord
00064     C_OUTLINE_FRAG(ICOORD start_pt,
00065                    ICOORD end_pt,       //end coord
00066                    C_OUTLINE *outline,  //source of steps
00067                    INT16 start_index,
00068                    INT16 end_index);
00069                                  //other end
00070     C_OUTLINE_FRAG(C_OUTLINE_FRAG *head, INT16 tail_y); 
00071     C_OUTLINE *close();  //copy to outline
00072     C_OUTLINE_FRAG & operator= ( //assign
00073       const C_OUTLINE_FRAG & src);
00074 
00075     ICOORD start;                //start coord
00076     ICOORD end;                  //end coord
00077     DIR128 *steps;                //step array
00078     INT32 stepcount;             //no of steps
00079     C_OUTLINE_FRAG *other_end;   //head if a tail
00080     INT16 ycoord;                //coord of cut pt
00081 
00082   private:
00083 };
00084 
00085 ELISTIZEH (OUTLINE_FRAG) ELISTIZEH (C_OUTLINE_FRAG)
00088 extern INT_VAR_H (textord_fp_chop_error, 2,
00089 "Max allowed bending of chop cells");
00090 extern double_VAR_H (textord_fp_chop_snap, 0.5,
00091 "Max distance of chop pt from vertex");
00094 ROW *fixed_pitch_words(                 //find lines
00095                        TO_ROW *row,     //row to do
00096                        FCOORD rotation  //for drawing
00097                       );
00098 WERD *add_repeated_word(                         //move repeated word
00099                         WERD_IT *rep_it,         //repeated words
00100                         INT16 &rep_left,         //left edge of word
00101                         INT16 &prev_chop_coord,  //previous word end
00102                         UINT8 &blanks,           //no of blanks
00103                         float pitch,             //char cell size
00104                         WERD_IT *word_it         //list of words
00105                        );
00106 void split_to_blob(                                 //split the blob
00107                    BLOBNBOX *blob,                  //blob to split
00108                    INT16 chop_coord,                //place to chop
00109                    float pitch_error,               //allowed deviation
00110                    OUTLINE_LIST *left_outlines,     //left half of chop
00111                    C_OUTLINE_LIST *left_coutlines,  //for cblobs
00112                    OUTLINE_LIST *right_outlines,    //right half of chop
00113                    C_OUTLINE_LIST *right_coutlines);
00114 void fixed_chop_blob(                              //split the blob
00115                      PBLOB *blob,                  //blob to split
00116                      INT16 chop_coord,             //place to chop
00117                      float pitch_error,            //allowed deviation
00118                      OUTLINE_LIST *left_outlines,  //left half of chop
00119                      OUTLINE_LIST *right_outlines  //right half of chop
00120                     );
00121 void fixed_split_outline(                      //chop the outline
00122                          OUTLINE *srcline,     //source outline
00123                          INT16 chop_coord,     //place to chop
00124                          float pitch_error,    //allowed deviation
00125                          OUTLINE_IT *left_it,  //left half of chop
00126                          OUTLINE_IT *right_it  //right half of chop
00127                         );
00128 BOOL8 fixed_chop_outline(                                //chop the outline
00129                          OUTLINE *srcline,               //source outline
00130                          INT16 chop_coord,               //place to chop
00131                          float pitch_error,              //allowed deviation
00132                          OUTLINE_FRAG_LIST *left_frags,  //left half of chop
00133                          OUTLINE_FRAG_LIST *right_frags  //right half of chop
00134                         );
00135 void save_chop_fragment(                          //chop the outline
00136                         POLYPT_IT *head_it,       //head of fragment
00137                         POLYPT_IT *tail_it,       //tail of fragment
00138                         OUTLINE_FRAG_LIST *frags  //fragment list
00139                        );
00140 void add_frag_to_list(                          //ordered add
00141                       OUTLINE_FRAG *frag,       //fragment to add
00142                       OUTLINE_FRAG_LIST *frags  //fragment list
00143                      );
00144 void insert_chop_pt(                  //make chop
00145                     POLYPT_IT *it,    //iterator
00146                     INT16 chop_coord  //required chop pt
00147                    );
00148 FCOORD find_chop_coords(                  //make chop
00149                         POLYPT_IT *it,    //iterator
00150                         INT16 chop_coord  //required chop pt
00151                        );
00152 void insert_extra_pt(               //make extra
00153                      POLYPT_IT *it  //iterator
00154                     );
00155 void close_chopped_fragments(                           //chop the outline
00156                              OUTLINE_FRAG_LIST *frags,  //list to clear
00157                              OUTLINE_LIST *children,    //potential children
00158                              OUTLINE_IT *dest_it        //output list
00159                             );
00160 void join_chopped_fragments(                       //join pieces
00161                             OUTLINE_FRAG *bottom,  //bottom of cut
00162                             OUTLINE_FRAG *top      //top of cut
00163                            );
00164 void fixed_chop_cblob(                                //split the blob
00165                       C_BLOB *blob,                   //blob to split
00166                       INT16 chop_coord,               //place to chop
00167                       float pitch_error,              //allowed deviation
00168                       C_OUTLINE_LIST *left_outlines,  //left half of chop
00169                       C_OUTLINE_LIST *right_outlines  //right half of chop
00170                      );
00171 void fixed_split_coutline(                        //chop the outline
00172                           C_OUTLINE *srcline,     //source outline
00173                           INT16 chop_coord,       //place to chop
00174                           float pitch_error,      //allowed deviation
00175                           C_OUTLINE_IT *left_it,  //left half of chop
00176                           C_OUTLINE_IT *right_it  //right half of chop
00177                          );
00178 BOOL8 fixed_chop_coutline(                                  //chop the outline
00179                           C_OUTLINE *srcline,               //source outline
00180                           INT16 chop_coord,                 //place to chop
00181                           float pitch_error,                //allowed deviation
00182                           C_OUTLINE_FRAG_LIST *left_frags,  //left half of chop
00183                           C_OUTLINE_FRAG_LIST *right_frags  //right half of chop
00184                          );
00185 INT16 next_anti_left_seg(                     //chop the outline
00186                          C_OUTLINE *srcline,  //source outline
00187                          INT16 tail_index,    //of tailpos
00188                          INT16 startindex,    //end of search
00189                          INT32 length,        //of outline
00190                          INT16 chop_coord,    //place to chop
00191                          float pitch_error,   //allowed deviation
00192                          ICOORD *tail_pos     //current position
00193                         );
00194 INT16 next_anti_right_seg(                     //chop the outline
00195                           C_OUTLINE *srcline,  //source outline
00196                           INT16 tail_index,    //of tailpos
00197                           INT16 startindex,    //end of search
00198                           INT32 length,        //of outline
00199                           INT16 chop_coord,    //place to chop
00200                           float pitch_error,   //allowed deviation
00201                           ICOORD *tail_pos     //current position
00202                          );
00203 INT16 next_clock_left_seg(                     //chop the outline
00204                           C_OUTLINE *srcline,  //source outline
00205                           INT16 tail_index,    //of tailpos
00206                           INT16 startindex,    //end of search
00207                           INT32 length,        //of outline
00208                           INT16 chop_coord,    //place to chop
00209                           float pitch_error,   //allowed deviation
00210                           ICOORD *tail_pos     //current position
00211                          );
00212 INT16 next_clock_right_seg(                     //chop the outline
00213                            C_OUTLINE *srcline,  //source outline
00214                            INT16 tail_index,    //of tailpos
00215                            INT16 startindex,    //end of search
00216                            INT32 length,        //of outline
00217                            INT16 chop_coord,    //place to chop
00218                            float pitch_error,   //allowed deviation
00219                            ICOORD *tail_pos     //current position
00220                           );
00221 void save_chop_cfragment(                            //chop the outline
00222                          INT16 head_index,           //head of fragment
00223                          ICOORD head_pos,            //head of fragment
00224                          INT16 tail_index,           //tail of fragment
00225                          ICOORD tail_pos,            //tail of fragment
00226                          C_OUTLINE *srcline,         //source of edgesteps
00227                          C_OUTLINE_FRAG_LIST *frags  //fragment list
00228                         );
00229 void add_frag_to_list(                            //ordered add
00230                       C_OUTLINE_FRAG *frag,       //fragment to add
00231                       C_OUTLINE_FRAG_LIST *frags  //fragment list
00232                      );
00233 void close_chopped_cfragments(                             //chop the outline
00234                               C_OUTLINE_FRAG_LIST *frags,  //list to clear
00235                               C_OUTLINE_LIST *children,    //potential children
00236                               float pitch_error,           //allowed shrinkage
00237                               C_OUTLINE_IT *dest_it        //output list
00238                              );
00239 C_OUTLINE *join_chopped_fragments(                         //join pieces
00240                                   C_OUTLINE_FRAG *bottom,  //bottom of cut
00241                                   C_OUTLINE_FRAG *top      //top of cut
00242                                  );
00243 void join_segments(                         //join pieces
00244                    C_OUTLINE_FRAG *bottom,  //bottom of cut
00245                    C_OUTLINE_FRAG *top      //top of cut
00246                   );
00247 #endif

Generated on Wed Feb 28 19:49:11 2007 for Tesseract by  doxygen 1.5.1