00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OLDBASEL_H
00021 #define OLDBASEL_H
00022
00023 #include "params.h"
00024 #include "blobbox.h"
00025 #include "notdll.h"
00026
00027 extern BOOL_VAR_H (textord_really_old_xheight, FALSE,
00028 "Use original wiseowl xheight");
00029 extern BOOL_VAR_H (textord_oldbl_debug, FALSE,
00030 "Debug old baseline generation");
00031 extern BOOL_VAR_H (textord_debug_baselines, FALSE,
00032 "Debug baseline generation");
00033 extern BOOL_VAR_H (textord_oldbl_paradef, TRUE, "Use para default mechanism");
00034 extern BOOL_VAR_H (textord_oldbl_split_splines, TRUE,
00035 "Split stepped splines");
00036 extern BOOL_VAR_H (textord_oldbl_merge_parts, TRUE,
00037 "Merge suspect partitions");
00038 extern BOOL_VAR_H (oldbl_xhfix, FALSE,
00039 "Fix bug in modes threshold for xheights");
00040 extern INT_VAR_H (oldbl_holed_losscount, 10,
00041 "Max lost before fallback line used");
00042 extern double_VAR_H (oldbl_dot_error_size, 1.26, "Max aspect ratio of a dot");
00043 extern double_VAR_H (textord_oldbl_jumplimit, 0.15,
00044 "X fraction for new partition");
00045 int get_blob_coords(
00046 TO_ROW *row,
00047 inT32 lineheight,
00048 TBOX *blobcoords,
00049 BOOL8 &holed_line,
00050 int &outcount
00051 );
00052 void make_first_baseline (
00053 TBOX blobcoords[],
00054 int blobcount,
00055 int xcoords[],
00056 int ycoords[],
00057 QSPLINE * spline,
00058 QSPLINE * baseline,
00059 float jumplimit
00060 );
00061 void make_holed_baseline (
00062 TBOX blobcoords[],
00063 int blobcount,
00064 QSPLINE * spline,
00065 QSPLINE * baseline,
00066 float gradient
00067 );
00068 int partition_line (
00069 TBOX blobcoords[],
00070 int blobcount,
00071 int *numparts,
00072 char partids[],
00073 int partsizes[],
00074 QSPLINE * spline,
00075 float jumplimit,
00076 float ydiffs[]
00077 );
00078 void merge_oldbl_parts (
00079 TBOX blobcoords[],
00080 int blobcount,
00081 char partids[],
00082 int partsizes[],
00083 int biggestpart,
00084 float jumplimit
00085 );
00086 int get_ydiffs (
00087 TBOX blobcoords[],
00088 int blobcount,
00089 QSPLINE * spline,
00090 float ydiffs[]
00091 );
00092 int choose_partition (
00093 register float diff,
00094 float partdiffs[],
00095 int lastpart,
00096 float jumplimit,
00097 float* drift,
00098 float* last_delta,
00099 int *partcount
00100 );
00101 int partition_coords (
00102 TBOX blobcoords[],
00103 int blobcount,
00104 char partids[],
00105 int bestpart,
00106 int xcoords[],
00107 int ycoords[]
00108 );
00109 int segment_spline (
00110 TBOX blobcoords[],
00111 int blobcount,
00112 int xcoords[],
00113 int ycoords[],
00114 int degree, int pointcount,
00115 int xstarts[]
00116 );
00117 BOOL8 split_stepped_spline (
00118 QSPLINE * baseline,
00119 float jumplimit,
00120 int xcoords[],
00121 int xstarts[],
00122 int &segments
00123 );
00124 void insert_spline_point (
00125 int xstarts[],
00126 int segment,
00127 int coord1,
00128 int coord2, int &segments
00129 );
00130 void find_lesser_parts (
00131 TO_ROW * row,
00132 TBOX blobcoords[],
00133 int blobcount,
00134 char partids[],
00135 int partsizes[],
00136 int partcount,
00137 int bestpart
00138 );
00139
00140 void old_first_xheight (
00141 TO_ROW * row,
00142 TBOX blobcoords[],
00143 int initialheight,
00144 int blobcount,
00145 QSPLINE * baseline,
00146 float jumplimit
00147 );
00148
00149 void make_first_xheight (
00150 TO_ROW * row,
00151 TBOX blobcoords[],
00152 int lineheight,
00153 int init_lineheight,
00154 int blobcount,
00155 QSPLINE * baseline,
00156 float jumplimit
00157 );
00158
00159 int *make_height_array (
00160 TBOX blobcoords[],
00161 int blobcount,
00162 QSPLINE * baseline
00163 );
00164
00165 void find_top_modes (
00166 STATS * stats,
00167 int statnum,
00168 int modelist[], int modenum
00169 );
00170
00171 void pick_x_height(TO_ROW * row,
00172 int modelist[],
00173 int lefts[], int rights[],
00174 STATS * heightstat,
00175 int mode_threshold);
00176 #endif