@@ -177,7 +177,7 @@ Textord::Textord(CCStruct *ccstruct)
177177void Textord::TextordPage (PageSegMode pageseg_mode, const FCOORD &reskew, int width, int height,
178178 Image binary_pix, Image thresholds_pix, Image grey_pix, bool use_box_bottoms,
179179 BLOBNBOX_LIST *diacritic_blobs, BLOCK_LIST *blocks,
180- TO_BLOCK_LIST *to_blocks) {
180+ TO_BLOCK_LIST *to_blocks, float *gradient ) {
181181 page_tr_.set_x (width);
182182 page_tr_.set_y (height);
183183 if (to_blocks->empty ()) {
@@ -219,15 +219,14 @@ void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD &reskew, int wi
219219 TO_BLOCK_IT to_block_it (to_blocks);
220220 TO_BLOCK *to_block = to_block_it.data ();
221221 // Make the rows in the block.
222- float gradient;
223222 // Do it the old fashioned way.
224223 if (PSM_LINE_FIND_ENABLED (pageseg_mode)) {
225- gradient = make_rows (page_tr_, to_blocks);
224+ * gradient = make_rows (page_tr_, to_blocks);
226225 } else if (!PSM_SPARSE (pageseg_mode)) {
227226 // RAW_LINE, SINGLE_LINE, SINGLE_WORD and SINGLE_CHAR all need a single row.
228- gradient = make_single_row (page_tr_, pageseg_mode != PSM_RAW_LINE, to_block, to_blocks);
227+ * gradient = make_single_row (page_tr_, pageseg_mode != PSM_RAW_LINE, to_block, to_blocks);
229228 } else {
230- gradient = 0 .0f ;
229+ * gradient = 0 .0f ;
231230 }
232231 BaselineDetect baseline_detector (textord_baseline_debug, reskew, to_blocks);
233232 baseline_detector.ComputeStraightBaselines (use_box_bottoms);
@@ -236,7 +235,7 @@ void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD &reskew, int wi
236235 // Now make the words in the lines.
237236 if (PSM_WORD_FIND_ENABLED (pageseg_mode)) {
238237 // SINGLE_LINE uses the old word maker on the single line.
239- make_words (this , page_tr_, gradient, blocks, to_blocks);
238+ make_words (this , page_tr_, * gradient, blocks, to_blocks);
240239 } else {
241240 // SINGLE_WORD and SINGLE_CHAR cram all the blobs into a
242241 // single word, and in SINGLE_CHAR mode, all the outlines
0 commit comments