904 for (word_it.mark_cycle_pt (); !word_it.cycled_list (); word_it.forward ()) {
905 word = word_it.data ();
915 (
double *)
alloc_mem ((blob_count + row->baseline.segments) * 3 *
920 xstarts[0] = row->baseline.xcoords[0];
921 for (word_it.mark_cycle_pt (); !word_it.cycled_list (); word_it.forward ()) {
922 word = word_it.data ();
925 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();
926 blob_it.forward ()) {
927 blob = blob_it.data ();
929 x_centre = (blob_box.
left () + blob_box.
right ()) / 2.0;
935 if (ydiff < blshift_maxshift
937 if (xstarts[dest_index] >= x_centre)
938 xstarts[dest_index] = blob_box.
left ();
939 coeffs[dest_index * 3] = 0;
940 coeffs[dest_index * 3 + 1] = 0;
941 coeffs[dest_index * 3 + 2] = blob_box.
bottom ();
944 xstarts[dest_index] = blob_box.
right () + 1;
947 if (xstarts[dest_index] <= x_centre) {
948 while (row->baseline.xcoords[src_index + 1] <= x_centre
949 && src_index < row->
baseline.segments - 1) {
950 if (row->baseline.xcoords[src_index + 1] >
951 xstarts[dest_index]) {
952 coeffs[dest_index * 3] =
953 row->baseline.quadratics[src_index].
a;
954 coeffs[dest_index * 3 + 1] =
955 row->baseline.quadratics[src_index].
b;
956 coeffs[dest_index * 3 + 2] =
957 row->baseline.quadratics[src_index].
c;
959 xstarts[dest_index] =
960 row->baseline.xcoords[src_index + 1];
964 coeffs[dest_index * 3] =
965 row->baseline.quadratics[src_index].
a;
966 coeffs[dest_index * 3 + 1] =
967 row->baseline.quadratics[src_index].
b;
968 coeffs[dest_index * 3 + 2] =
969 row->baseline.quadratics[src_index].
c;
971 xstarts[dest_index] = row->baseline.xcoords[src_index + 1];
976 while (src_index < row->
baseline.segments
977 && row->baseline.xcoords[src_index + 1] <= xstarts[dest_index])
979 while (src_index < row->
baseline.segments) {
980 coeffs[dest_index * 3] = row->baseline.quadratics[src_index].
a;
981 coeffs[dest_index * 3 + 1] = row->baseline.quadratics[src_index].
b;
982 coeffs[dest_index * 3 + 2] = row->baseline.quadratics[src_index].
c;
985 xstarts[dest_index] = row->baseline.xcoords[src_index];
988 row->baseline =
QSPLINE (dest_index, xstarts, coeffs);
void free_mem(void *oldchunk)
float base_line(float xpos) const
TBOX bounding_box() const
void * alloc_mem(inT32 count)
C_BLOB_LIST * cblob_list()