911 for (word_it.mark_cycle_pt (); !word_it.cycled_list (); word_it.forward ()) {
912 word = word_it.data ();
919 std::vector<int32_t> xstarts(blob_count + row->baseline.segments + 1);
921 std::vector<double> coeffs((blob_count + row->baseline.segments) * 3);
925 xstarts[0] = row->baseline.xcoords[0];
926 for (word_it.mark_cycle_pt (); !word_it.cycled_list (); word_it.forward ()) {
927 word = word_it.data ();
930 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();
931 blob_it.forward ()) {
932 blob = blob_it.data ();
934 x_centre = (blob_box.
left () + blob_box.
right ()) / 2.0;
940 if (ydiff < blshift_maxshift
942 if (xstarts[dest_index] >= x_centre)
943 xstarts[dest_index] = blob_box.
left ();
944 coeffs[dest_index * 3] = 0;
945 coeffs[dest_index * 3 + 1] = 0;
946 coeffs[dest_index * 3 + 2] = blob_box.
bottom ();
949 xstarts[dest_index] = blob_box.
right () + 1;
952 if (xstarts[dest_index] <= x_centre) {
953 while (row->baseline.xcoords[src_index + 1] <= x_centre
954 && src_index < row->
baseline.segments - 1) {
955 if (row->baseline.xcoords[src_index + 1] >
956 xstarts[dest_index]) {
957 coeffs[dest_index * 3] =
958 row->baseline.quadratics[src_index].
a;
959 coeffs[dest_index * 3 + 1] =
960 row->baseline.quadratics[src_index].
b;
961 coeffs[dest_index * 3 + 2] =
962 row->baseline.quadratics[src_index].
c;
964 xstarts[dest_index] =
965 row->baseline.xcoords[src_index + 1];
969 coeffs[dest_index * 3] =
970 row->baseline.quadratics[src_index].
a;
971 coeffs[dest_index * 3 + 1] =
972 row->baseline.quadratics[src_index].
b;
973 coeffs[dest_index * 3 + 2] =
974 row->baseline.quadratics[src_index].
c;
976 xstarts[dest_index] = row->baseline.xcoords[src_index + 1];
981 while (src_index < row->
baseline.segments
982 && row->baseline.xcoords[src_index + 1] <= xstarts[dest_index])
984 while (src_index < row->
baseline.segments) {
985 coeffs[dest_index * 3] = row->baseline.quadratics[src_index].
a;
986 coeffs[dest_index * 3 + 1] = row->baseline.quadratics[src_index].
b;
987 coeffs[dest_index * 3 + 2] = row->baseline.quadratics[src_index].
c;
990 xstarts[dest_index] = row->baseline.xcoords[src_index];
993 row->baseline =
QSPLINE(dest_index, &xstarts[0], &coeffs[0]);
float base_line(float xpos) const
C_BLOB_LIST * cblob_list()
TBOX bounding_box() const