Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 343211
Collapse All | Expand All

(-)image/svshowim.cpp (+4 lines)
Lines 6-11 Link Here
6
#include "config_auto.h"
6
#include "config_auto.h"
7
#endif
7
#endif
8
8
9
#ifndef GRAPHICS_DISABLED
9
#include "allheaders.h"
10
#include "allheaders.h"
10
11
11
#include "svshowim.h"
12
#include "svshowim.h"
Lines 36-38 Link Here
36
  window->Image(pix, xpos, window->TranslateYCoordinate(yext) + ypos);
37
  window->Image(pix, xpos, window->TranslateYCoordinate(yext) + ypos);
37
  pixDestroy(&pix);
38
  pixDestroy(&pix);
38
}
39
}
40
41
#endif  // GRAPHICS_DISABLED
42
(-)ccmain/pgedit.cpp (-2 / +7 lines)
Lines 705-711 Link Here
705
 * Blank display of word then redisplay word according to current display mode
705
 * Blank display of word then redisplay word according to current display mode
706
 * settings
706
 * settings
707
 */
707
 */
708
#endif  // GRAPHICS_DISABLED
708
namespace tesseract {
709
namespace tesseract {
710
#ifndef GRAPHICS_DISABLED
709
BOOL8 Tesseract:: word_blank_and_set_display(BLOCK* block, ROW* row,
711
BOOL8 Tesseract:: word_blank_and_set_display(BLOCK* block, ROW* row,
710
                                             WERD_RES* word_res) {
712
                                             WERD_RES* word_res) {
711
  word_res->word->bounding_box().plot(image_win, ScrollView::BLACK,
713
  word_res->word->bounding_box().plot(image_win, ScrollView::BLACK,
Lines 896-901 Link Here
896
      editor_image_word_bb_color));
898
      editor_image_word_bb_color));
897
  return TRUE;
899
  return TRUE;
898
}
900
}
901
#endif  // GRAPHICS_DISABLED
899
902
900
/**
903
/**
901
 * word_dumper()
904
 * word_dumper()
Lines 919-925 Link Here
919
  return TRUE;
922
  return TRUE;
920
}
923
}
921
924
922
925
#ifndef GRAPHICS_DISABLED
923
/**
926
/**
924
 * word_set_display()  Word processor
927
 * word_set_display()  Word processor
925
 *
928
 *
Lines 936-942 Link Here
936
  word->set_display_flag(DF_BLAMER, word_display_mode.bit(DF_BLAMER));
939
  word->set_display_flag(DF_BLAMER, word_display_mode.bit(DF_BLAMER));
937
  return word_display(block, row, word_res);
940
  return word_display(block, row, word_res);
938
}
941
}
942
#endif  // GRAPHICS_DISABLED
943
939
}  // namespace tesseract
944
}  // namespace tesseract
940
945
941
946
942
#endif  // GRAPHICS_DISABLED
947
(-)ccmain/tesseractclass.h (+9 lines)
Lines 31-36 Link Here
31
#include "textord.h"
31
#include "textord.h"
32
#include "wordrec.h"
32
#include "wordrec.h"
33
33
34
// Include automatically generated configuration file if running autoconf.
35
#ifdef HAVE_CONFIG_H
36
#include "config_auto.h"
37
#endif
38
34
class PAGE_RES;
39
class PAGE_RES;
35
class PAGE_RES_IT;
40
class PAGE_RES_IT;
36
class BLOCK_LIST;
41
class BLOCK_LIST;
Lines 408-414 Link Here
408
413
409
  //// pgedit.h //////////////////////////////////////////////////////////
414
  //// pgedit.h //////////////////////////////////////////////////////////
410
  SVMenuNode *build_menu_new();
415
  SVMenuNode *build_menu_new();
416
  #ifndef GRAPHICS_DISABLED
411
  void pgeditor_main(int width, int height, PAGE_RES* page_res);
417
  void pgeditor_main(int width, int height, PAGE_RES* page_res);
418
  #endif  // GRAPHICS_DISABLED
412
  void process_image_event( // action in image win
419
  void process_image_event( // action in image win
413
                           const SVEvent &event);
420
                           const SVEvent &event);
414
  BOOL8 process_cmd_win_event(                 // UI command semantics
421
  BOOL8 process_cmd_win_event(                 // UI command semantics
Lines 424-430 Link Here
424
  BOOL8 word_bln_display(BLOCK* block, ROW* row, WERD_RES* word_res);
431
  BOOL8 word_bln_display(BLOCK* block, ROW* row, WERD_RES* word_res);
425
  BOOL8 word_blank_and_set_display(BLOCK* block, ROW* row, WERD_RES* word_res);
432
  BOOL8 word_blank_and_set_display(BLOCK* block, ROW* row, WERD_RES* word_res);
426
  BOOL8 word_set_display(BLOCK* block, ROW* row, WERD_RES* word_res);
433
  BOOL8 word_set_display(BLOCK* block, ROW* row, WERD_RES* word_res);
434
  //#ifndef GRAPHICS_DISABLED
427
  BOOL8 word_dumper(BLOCK* block, ROW* row, WERD_RES* word_res);
435
  BOOL8 word_dumper(BLOCK* block, ROW* row, WERD_RES* word_res);
436
  //#endif  // GRAPHICS_DISABLED
428
  //// reject.h //////////////////////////////////////////////////////////
437
  //// reject.h //////////////////////////////////////////////////////////
429
  void make_reject_map(            //make rej map for wd //detailed results
438
  void make_reject_map(            //make rej map for wd //detailed results
430
                       WERD_RES *word,
439
                       WERD_RES *word,
(-)ccstruct/blobs.cpp (+2 lines)
Lines 221-226 Link Here
221
221
222
void TESSLINE::plot(ScrollView* window, ScrollView::Color color,
222
void TESSLINE::plot(ScrollView* window, ScrollView::Color color,
223
                    ScrollView::Color child_color) {
223
                    ScrollView::Color child_color) {
224
  #ifndef GRAPHICS_DISABLED
224
  if (is_hole)
225
  if (is_hole)
225
    window->Pen(child_color);
226
    window->Pen(child_color);
226
  else
227
  else
Lines 235-240 Link Here
235
    else
236
    else
236
      window->DrawTo(pt->pos.x, pt->pos.y);
237
      window->DrawTo(pt->pos.x, pt->pos.y);
237
  } while (pt != loop);
238
  } while (pt != loop);
239
  #endif  // GRAPHICS_DISABLED
238
}
240
}
239
241
240
// Iterate the given list of outlines, converting to TESSLINE by polygonal
242
// Iterate the given list of outlines, converting to TESSLINE by polygonal
(-)ccstruct/werd.h (+9 lines)
Lines 27-32 Link Here
27
#include          "blckerr.h"
27
#include          "blckerr.h"
28
#include          "stepblob.h"
28
#include          "stepblob.h"
29
29
30
// Include automatically generated configuration file if running autoconf.
31
#ifdef HAVE_CONFIG_H
32
#include "config_auto.h"
33
#endif
34
30
enum WERD_FLAGS
35
enum WERD_FLAGS
31
{
36
{
32
  W_SEGMENTED,                   //< correctly segmented
37
  W_SEGMENTED,                   //< correctly segmented
Lines 141-157 Link Here
141
    // tprintf word metadata (but not blob innards)
146
    // tprintf word metadata (but not blob innards)
142
    void print();
147
    void print();
143
148
149
    #ifndef GRAPHICS_DISABLED
144
    // plot word on window in a uniform colour
150
    // plot word on window in a uniform colour
145
    void plot(ScrollView *window, ScrollView::Color colour);
151
    void plot(ScrollView *window, ScrollView::Color colour);
152
    #endif  // GRAPHICS_DISABLED
146
153
147
    // Get the next color in the (looping) rainbow.
154
    // Get the next color in the (looping) rainbow.
148
    static ScrollView::Color NextColor(ScrollView::Color colour);
155
    static ScrollView::Color NextColor(ScrollView::Color colour);
149
156
157
    #ifndef GRAPHICS_DISABLED
150
    // plot word on window in a rainbow of colours
158
    // plot word on window in a rainbow of colours
151
    void plot(ScrollView *window);
159
    void plot(ScrollView *window);
152
160
153
    // plot rejected blobs in a rainbow of colours
161
    // plot rejected blobs in a rainbow of colours
154
    void plot_rej_blobs(ScrollView *window);
162
    void plot_rej_blobs(ScrollView *window);
163
    #endif  // GRAPHICS_DISABLED
155
164
156
 private:
165
 private:
157
    uinT8 blanks;                // no of blanks
166
    uinT8 blanks;                // no of blanks
(-)ccstruct/werd.cpp (-12 / +4 lines)
Lines 23-33 Link Here
23
#include "linlsq.h"
23
#include "linlsq.h"
24
#include "werd.h"
24
#include "werd.h"
25
25
26
// Include automatically generated configuration file if running autoconf.
27
#ifdef HAVE_CONFIG_H
28
#include "config_auto.h"
29
#endif
30
31
#define FIRST_COLOUR    ScrollView::RED         //< first rainbow colour
26
#define FIRST_COLOUR    ScrollView::RED         //< first rainbow colour
32
#define LAST_COLOUR     ScrollView::AQUAMARINE  //< last rainbow colour
27
#define LAST_COLOUR     ScrollView::AQUAMARINE  //< last rainbow colour
33
#define CHILD_COLOUR    ScrollView::BROWN       //< colour of children
28
#define CHILD_COLOUR    ScrollView::BROWN       //< colour of children
Lines 291-301 Link Here
291
  }
286
  }
292
  plot_rej_blobs(window);
287
  plot_rej_blobs(window);
293
}
288
}
294
#endif
289
#endif  // GRAPHICS_DISABLED
295
290
296
297
#ifndef GRAPHICS_DISABLED
298
299
// Get the next color in the (looping) rainbow.
291
// Get the next color in the (looping) rainbow.
300
ScrollView::Color WERD::NextColor(ScrollView::Color colour) {
292
ScrollView::Color WERD::NextColor(ScrollView::Color colour) {
301
  ScrollView::Color next = static_cast<ScrollView::Color>(colour + 1);
293
  ScrollView::Color next = static_cast<ScrollView::Color>(colour + 1);
Lines 304-309 Link Here
304
  return next;
296
  return next;
305
}
297
}
306
298
299
#ifndef GRAPHICS_DISABLED
307
/**
300
/**
308
 * WERD::plot
301
 * WERD::plot
309
 *
302
 *
Lines 319-325 Link Here
319
  }
312
  }
320
  plot_rej_blobs(window);
313
  plot_rej_blobs(window);
321
}
314
}
322
#endif
323
315
324
316
325
/**
317
/**
Lines 328-341 Link Here
328
 * Draw the WERD rejected blobs in window - ALWAYS GREY
320
 * Draw the WERD rejected blobs in window - ALWAYS GREY
329
 */
321
 */
330
322
331
#ifndef GRAPHICS_DISABLED
323
332
void WERD::plot_rej_blobs(ScrollView *window) {
324
void WERD::plot_rej_blobs(ScrollView *window) {
333
  C_BLOB_IT it = &rej_cblobs;
325
  C_BLOB_IT it = &rej_cblobs;
334
  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
326
  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
335
    it.data()->plot(window, ScrollView::GREY, ScrollView::GREY);
327
    it.data()->plot(window, ScrollView::GREY, ScrollView::GREY);
336
  }
328
  }
337
}
329
}
338
#endif
330
#endif  // GRAPHICS_DISABLED
339
331
340
332
341
/**
333
/**
(-)ccstruct/statistc.h (+3 lines)
Lines 108-113 Link Here
108
  // Prints summary stats only of the histogram.
108
  // Prints summary stats only of the histogram.
109
  void print_summary() const;
109
  void print_summary() const;
110
110
111
  #ifndef GRAPHICS_DISABLED
111
  // Draws the histogram as a series of rectangles.
112
  // Draws the histogram as a series of rectangles.
112
  void plot(ScrollView* window,   // window to draw in
113
  void plot(ScrollView* window,   // window to draw in
113
            float xorigin,   // origin of histo
114
            float xorigin,   // origin of histo
Lines 123-128 Link Here
123
                float xscale,    // size of one unit
124
                float xscale,    // size of one unit
124
                float yscale,    // size of one uint
125
                float yscale,    // size of one uint
125
                ScrollView::Color colour) const;  // colour to draw in
126
                ScrollView::Color colour) const;  // colour to draw in
127
  #endif  // GRAPHICS_DISABLED
128
126
 private:
129
 private:
127
  inT32 rangemin_;                // min of range
130
  inT32 rangemin_;                // min of range
128
  // rangemax_ is not well named as it is really one past the max.
131
  // rangemax_ is not well named as it is really one past the max.
(-)viewer/scrollview.h (+5 lines)
Lines 36-41 Link Here
36
36
37
#include <stdio.h>
37
#include <stdio.h>
38
38
39
// Include automatically generated configuration file if running autoconf.
40
#ifdef HAVE_CONFIG_H
41
#include "config_auto.h"
42
#endif
43
39
class ScrollView;
44
class ScrollView;
40
class SVNetwork;
45
class SVNetwork;
41
class SVMutex;
46
class SVMutex;
(-)viewer/svpaint.cpp (-1 / +2 lines)
Lines 11-22 Link Here
11
// - A LMB click either draws point-to-point, point or text.
11
// - A LMB click either draws point-to-point, point or text.
12
// - A LMB dragging either draws a line, a rectangle or ellipse.
12
// - A LMB dragging either draws a line, a rectangle or ellipse.
13
13
14
15
#include "scrollview.h"
14
#include "scrollview.h"
16
#include "svmnode.h"
15
#include "svmnode.h"
17
#include <stdlib.h>
16
#include <stdlib.h>
18
#include <iostream>
17
#include <iostream>
19
18
19
#ifndef GRAPHICS_DISABLED
20
// The current color values we use, initially white (== ScrollView::WHITE).
20
// The current color values we use, initially white (== ScrollView::WHITE).
21
int rgb[3] = { 255, 255, 255 };
21
int rgb[3] = { 255, 255, 255 };
22
22
Lines 218-220 Link Here
218
	if (argc > 1) { server_name = argv[1]; } else { server_name = "localhost"; }
218
	if (argc > 1) { server_name = argv[1]; } else { server_name = "localhost"; }
219
	SVPaint svp(server_name);
219
	SVPaint svp(server_name);
220
}
220
}
221
#endif  // GRAPHICS_DISABLED
(-)configure.ac (-3 / +18 lines)
Lines 75-86 Link Here
75
75
76
AC_MSG_CHECKING(--enable-graphics argument)
76
AC_MSG_CHECKING(--enable-graphics argument)
77
AC_ARG_ENABLE([graphics],
77
AC_ARG_ENABLE([graphics],
78
    [  --enable-graphics         Enable graphics (ScrollView) (default).],
78
 [AC_HELP_STRING([--enable-graphics],[enable graphics (ScrollView) (default)])
79
AC_HELP_STRING([--disable-graphics],[disable graphics (ScrollView)])],
79
    [enable_graphics=$enableval],
80
    [enable_graphics=$enableval],
80
    [enable_graphics="yes"])
81
    [enable_graphics="yes"])
81
AC_MSG_RESULT($enable_graphics)
82
AC_MSG_RESULT($enable_graphics)
82
if test "$enable_graphics" = "no"; then
83
if test "$enable_graphics" = "no"; then
83
  AC_DEFINE([DISABLE_GRAPHICS], [], [Disable graphics])
84
  AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics]) 
84
fi
85
fi
85
86
86
# check whether to build embedded version
87
# check whether to build embedded version
Lines 97-106 Link Here
97
  AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
98
  AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
98
fi
99
fi
99
100
101
# check whether to build embedded version
102
AC_MSG_CHECKING(--enable-embedded argument)
103
AC_ARG_ENABLE([embedded],
104
    [  --enable-embedded       enable embedded build (default=no)],
105
    [enable_embedded=$enableval],
106
    [enable_embedded="no"])
107
AC_MSG_RESULT($enable_embedded)
108
AM_CONDITIONAL([EMBEDDED], [test "$enable_embedded" = "yes"])
109
if test "$enable_embedded" = "yes"; then
110
  #AC_DEFINE([EMBEDDED], [], [Embedded Mode])
111
  AC_SUBST([AM_CXXFLAGS], [-DEMBEDDED])
112
  AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
113
fi
114
100
# check whether to build multiple libraries
115
# check whether to build multiple libraries
101
AC_MSG_CHECKING(--enable-multiple-libraries argument)
116
AC_MSG_CHECKING(--enable-multiple-libraries argument)
102
AC_ARG_ENABLE([multiple-libraries],
117
AC_ARG_ENABLE([multiple-libraries],
103
    [  --enable-multiple-libraries         Enable multiple libraries.],
118
    [AC_HELP_STRING([--enable-multiple-libraries],[enable multiple libraries (default=no)])],
104
    [enable_mlibs=$enableval],
119
    [enable_mlibs=$enableval],
105
    [enable_mlibs="no"])
120
    [enable_mlibs="no"])
106
AC_MSG_RESULT($enable_mlibs)
121
AC_MSG_RESULT($enable_mlibs)
(-)ccutil/scanutils.cpp (+2 lines)
Lines 19-24 Link Here
19
// See the License for the specific language governing permissions and
19
// See the License for the specific language governing permissions and
20
// limitations under the License.
20
// limitations under the License.
21
21
22
#ifdef EMBEDDED
23
22
#include <ctype.h>
24
#include <ctype.h>
23
#include <stdarg.h>
25
#include <stdarg.h>
24
#include <stddef.h>
26
#include <stddef.h>
(-)textord/tordmain.cpp (-2 / +6 lines)
Lines 242-249 Link Here
242
  TO_BLOCK_IT block_it = blocks;          // destination iterator
242
  TO_BLOCK_IT block_it = blocks;          // destination iterator
243
  TO_BLOCK *block;                        // created block
243
  TO_BLOCK *block;                        // created block
244
244
245
  #ifndef GRAPHICS_DISABLED
245
  if (to_win != NULL)
246
  if (to_win != NULL)
246
    to_win->Clear();
247
    to_win->Clear();
248
  #endif  // GRAPHICS_DISABLED
249
247
  for (block_it.mark_cycle_pt(); !block_it.cycled_list();
250
  for (block_it.mark_cycle_pt(); !block_it.cycled_list();
248
       block_it.forward()) {
251
       block_it.forward()) {
249
    block = block_it.data();
252
    block = block_it.data();
Lines 258-264 Link Here
258
         tesseract::CCStruct::kXHeightFraction;
261
         tesseract::CCStruct::kXHeightFraction;
259
    block->line_size *= textord_min_linesize;
262
    block->line_size *= textord_min_linesize;
260
    block->max_blob_size = block->line_size * textord_excess_blobsize;
263
    block->max_blob_size = block->line_size * textord_excess_blobsize;
261
#ifndef GRAPHICS_DISABLED
264
265
    #ifndef GRAPHICS_DISABLED
262
    if (textord_show_blobs && testing_on) {
266
    if (textord_show_blobs && testing_on) {
263
      if (to_win == NULL)
267
      if (to_win == NULL)
264
        create_to_win(page_tr);
268
        create_to_win(page_tr);
Lines 272-278 Link Here
272
      plot_box_list(to_win, &block->large_blobs, ScrollView::WHITE);
276
      plot_box_list(to_win, &block->large_blobs, ScrollView::WHITE);
273
      plot_box_list(to_win, &block->blobs, ScrollView::WHITE);
277
      plot_box_list(to_win, &block->blobs, ScrollView::WHITE);
274
    }
278
    }
275
#endif
279
    #endif  // GRAPHICS_DISABLED
276
  }
280
  }
277
}
281
}
278
282
(-)textord/colpartitionset.cpp (+2 lines)
Lines 374-385 Link Here
374
// Display the edges of the columns at the given y coords.
374
// Display the edges of the columns at the given y coords.
375
void ColPartitionSet::DisplayColumnEdges(int y_bottom, int y_top,
375
void ColPartitionSet::DisplayColumnEdges(int y_bottom, int y_top,
376
                                         ScrollView* win) {
376
                                         ScrollView* win) {
377
  #ifndef GRAPHICS_DISABLED
377
  ColPartition_IT it(&parts_);
378
  ColPartition_IT it(&parts_);
378
  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
379
  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
379
    ColPartition* part = it.data();
380
    ColPartition* part = it.data();
380
    win->Line(part->LeftAtY(y_top), y_top, part->LeftAtY(y_bottom), y_bottom);
381
    win->Line(part->LeftAtY(y_top), y_top, part->LeftAtY(y_bottom), y_bottom);
381
    win->Line(part->RightAtY(y_top), y_top, part->RightAtY(y_bottom), y_bottom);
382
    win->Line(part->RightAtY(y_top), y_top, part->RightAtY(y_bottom), y_bottom);
382
  }
383
  }
384
  #endif  // GRAPHICS_DISABLED
383
}
385
}
384
386
385
// Return the ColumnSpanningType that best explains the columns overlapped
387
// Return the ColumnSpanningType that best explains the columns overlapped
(-)textord/tabfind.cpp (+8 lines)
Lines 460-467 Link Here
460
                             BLOBNBOX_LIST* image_blobs, TO_BLOCK* block,
460
                             BLOBNBOX_LIST* image_blobs, TO_BLOCK* block,
461
                             int min_gutter_width,
461
                             int min_gutter_width,
462
                             FCOORD* deskew, FCOORD* reskew) {
462
                             FCOORD* deskew, FCOORD* reskew) {
463
  #ifndef GRAPHICS_DISABLED
463
  ScrollView* tab_win = FindInitialTabVectors(image_blobs, min_gutter_width,
464
  ScrollView* tab_win = FindInitialTabVectors(image_blobs, min_gutter_width,
464
                                                  block);
465
                                                  block);
466
  #endif
465
  TabVector::MergeSimilarTabVectors(vertical_skew_, &vectors_, this);
467
  TabVector::MergeSimilarTabVectors(vertical_skew_, &vectors_, this);
466
  SortVectors();
468
  SortVectors();
467
  CleanupTabs();
469
  CleanupTabs();
Lines 459-464 Link Here
459
    return false;  // Skew angle is too large.
459
    return false;  // Skew angle is too large.
460
  part_grid->Deskew(*deskew);
460
  part_grid->Deskew(*deskew);
461
  ApplyTabConstraints();
461
  ApplyTabConstraints();
462
  #ifndef GRAPHICS_DISABLED
462
  if (textord_tabfind_show_finaltabs) {
463
  if (textord_tabfind_show_finaltabs) {
463
    tab_win = MakeWindow(640, 50, "FinalTabs");
464
    tab_win = MakeWindow(640, 50, "FinalTabs");
464
    if (textord_debug_images) {
465
    if (textord_debug_images) {
Lines 470-475 Link Here
470
    }
471
    }
471
    tab_win = DisplayTabVectors(tab_win);
472
    tab_win = DisplayTabVectors(tab_win);
472
  }
473
  }
474
  #endif  // GRAPHICS_DISABLED
473
  return true;
475
  return true;
474
}
476
}
475
477
Lines 597-602 Link Here
597
  left_tab_boxes_.sort(SortByBoxLeft<BLOBNBOX>);
603
  left_tab_boxes_.sort(SortByBoxLeft<BLOBNBOX>);
598
  right_tab_boxes_.sort(SortRightToLeft<BLOBNBOX>);
604
  right_tab_boxes_.sort(SortRightToLeft<BLOBNBOX>);
599
  ScrollView* tab_win = NULL;
605
  ScrollView* tab_win = NULL;
606
  #ifndef GRAPHICS_DISABLED
600
  if (textord_tabfind_show_initialtabs) {
607
  if (textord_tabfind_show_initialtabs) {
601
    tab_win = MakeWindow(0, 100, "InitialTabs");
608
    tab_win = MakeWindow(0, 100, "InitialTabs");
602
    tab_win->Pen(ScrollView::BLUE);
609
    tab_win->Pen(ScrollView::BLUE);
Lines 606-611 Link Here
606
    DisplayBoxVector(right_tab_boxes_, tab_win);
613
    DisplayBoxVector(right_tab_boxes_, tab_win);
607
    tab_win = DisplayTabs("Tabs", tab_win);
614
    tab_win = DisplayTabs("Tabs", tab_win);
608
  }
615
  }
616
  #endif  // GRAPHICS_DISABLED
609
  return tab_win;
617
  return tab_win;
610
}
618
}
611
619
Lines 857-862 Link Here
857
  // Set the aligned_text_ member of each blob, so text lines traces
859
  // Set the aligned_text_ member of each blob, so text lines traces
858
  // get terminated where there is a change from text to image.
860
  // get terminated where there is a change from text to image.
859
  ComputeBlobGoodness();
861
  ComputeBlobGoodness();
862
  #ifndef GRAPHICS_DISABLED
860
  if (tab_win != NULL)
863
  if (tab_win != NULL)
861
    tab_win->Pen(ScrollView::WHITE);
864
    tab_win->Pen(ScrollView::WHITE);
862
  // Accumulate column sections into a STATS
865
  // Accumulate column sections into a STATS
Lines 892-897 Link Here
892
  if (tab_win != NULL) {
892
  if (tab_win != NULL) {
893
    tab_win->Update();
893
    tab_win->Update();
894
  }
894
  }
895
  #endif
895
  // Now make a list of column widths.
896
  // Now make a list of column widths.
896
  ICOORDELT_IT w_it(&column_widths_);
897
  ICOORDELT_IT w_it(&column_widths_);
897
  int total_col_count = col_widths.get_total();
898
  int total_col_count = col_widths.get_total();
(-)textord/colfind.cpp (+7 lines)
Lines 304-314 Link Here
304
  // Recompute margins based on a local neighbourhood search.
304
  // Recompute margins based on a local neighbourhood search.
305
  part_grid_.GridFindMargins(best_columns_);
305
  part_grid_.GridFindMargins(best_columns_);
306
  SetPartitionTypes();
306
  SetPartitionTypes();
307
  #ifndef GRAPHICS_DISABLED
307
  if (textord_tabfind_show_initial_partitions) {
308
  if (textord_tabfind_show_initial_partitions) {
308
    ScrollView* part_win = MakeWindow(100, 300, "InitialPartitions");
309
    ScrollView* part_win = MakeWindow(100, 300, "InitialPartitions");
309
    part_grid_.DisplayBoxes(part_win);
310
    part_grid_.DisplayBoxes(part_win);
310
    DisplayTabVectors(part_win);
311
    DisplayTabVectors(part_win);
311
  }
312
  }
313
  #endif
312
314
313
  if (textord_tabfind_find_tables) {
315
  if (textord_tabfind_find_tables) {
314
    TableFinder table_finder;
316
    TableFinder table_finder;
Lines 328-333 Link Here
328
  part_grid_.FindFigureCaptions();
330
  part_grid_.FindFigureCaptions();
329
  part_grid_.RefinePartitionPartners(true);
331
  part_grid_.RefinePartitionPartners(true);
330
  SmoothPartnerRuns();
332
  SmoothPartnerRuns();
333
334
  #ifndef GRAPHICS_DISABLED
331
  if (textord_tabfind_show_partitions) {
335
  if (textord_tabfind_show_partitions) {
332
    ScrollView* window = MakeWindow(400, 300, "Partitions");
336
    ScrollView* window = MakeWindow(400, 300, "Partitions");
333
    if (textord_debug_images)
337
    if (textord_debug_images)
Lines 424-429 Link Here
424
      delete window->AwaitEvent(SVET_DESTROY);
429
      delete window->AwaitEvent(SVET_DESTROY);
425
    }
430
    }
426
  }
431
  }
432
  #endif  // GRAPHICS_DISABLED
427
  part_grid_.AssertNoDuplicates();
433
  part_grid_.AssertNoDuplicates();
428
  // Ownership of the ColPartitions moves from part_sets_ to part_grid_ here,
434
  // Ownership of the ColPartitions moves from part_sets_ to part_grid_ here,
429
  // and ownership of the BLOBNBOXes moves to the ColPartitions.
435
  // and ownership of the BLOBNBOXes moves to the ColPartitions.
Lines 442-447 Link Here
442
  DisplayBlocks(blocks);
448
  DisplayBlocks(blocks);
443
  RotateAndReskewBlocks(input_is_rtl, to_blocks);
449
  RotateAndReskewBlocks(input_is_rtl, to_blocks);
444
  int result = 0;
450
  int result = 0;
451
  #ifndef GRAPHICS_DISABLED
445
  if (blocks_win_ != NULL) {
452
  if (blocks_win_ != NULL) {
446
    bool waiting = false;
453
    bool waiting = false;
447
    do {
454
    do {
Lines 460-465 Link Here
460
      delete event;
467
      delete event;
461
    } while (waiting);
468
    } while (waiting);
462
  }
469
  }
470
  #endif  // GRAPHICS_DISABLED
463
  return result;
471
  return result;
464
}
472
}
465
473
(-)textord/tablefind.cpp (+2 lines)
Lines 742-747 Link Here
742
  set_global_median_xheight(static_cast<int>(xheight_stats.median() + 0.5));
742
  set_global_median_xheight(static_cast<int>(xheight_stats.median() + 0.5));
743
  set_global_median_blob_width(static_cast<int>(width_stats.median() + 0.5));
743
  set_global_median_blob_width(static_cast<int>(width_stats.median() + 0.5));
744
  set_global_median_ledding(static_cast<int>(ledding_stats.median() + 0.5));
744
  set_global_median_ledding(static_cast<int>(ledding_stats.median() + 0.5));
745
  #ifndef GRAPHICS_DISABLED
745
  if (textord_tablefind_show_stats) {
746
  if (textord_tablefind_show_stats) {
746
    const char* kWindowName = "X-height (R), X-width (G), and ledding (B)";
747
    const char* kWindowName = "X-height (R), X-width (G), and ledding (B)";
747
    ScrollView* stats_win = MakeWindow(500, 10, kWindowName);
748
    ScrollView* stats_win = MakeWindow(500, 10, kWindowName);
Lines 749-754 Link Here
749
    width_stats.plot(stats_win, 10, 200, 2, 15, ScrollView::GREEN);
750
    width_stats.plot(stats_win, 10, 200, 2, 15, ScrollView::GREEN);
750
    ledding_stats.plot(stats_win, 10, 200, 2, 15, ScrollView::BLUE);
751
    ledding_stats.plot(stats_win, 10, 200, 2, 15, ScrollView::BLUE);
751
  }
752
  }
753
  #endif  // GRAPHICS_DISABLED
752
}
754
}
753
755
754
void TableFinder::set_global_median_xheight(int xheight) {
756
void TableFinder::set_global_median_xheight(int xheight) {
(-)textord/strokewidth.cpp (+4 lines)
Lines 133-139 Link Here
133
133
134
StrokeWidth::~StrokeWidth() {
134
StrokeWidth::~StrokeWidth() {
135
  if (widths_win_ != NULL) {
135
  if (widths_win_ != NULL) {
136
    #ifndef GRAPHICS_DISABLED
136
    delete widths_win_->AwaitEvent(SVET_DESTROY);
137
    delete widths_win_->AwaitEvent(SVET_DESTROY);
138
    #endif  // GRAPHICS_DISABLED
137
    if (textord_tabfind_only_strokewidths)
139
    if (textord_tabfind_only_strokewidths)
138
      exit(0);
140
      exit(0);
139
    delete widths_win_;
141
    delete widths_win_;
Lines 491-501 Link Here
491
      best_blob->set_leader_on_right(true);
491
      best_blob->set_leader_on_right(true);
492
    else
492
    else
493
      best_blob->set_leader_on_left(true);
493
      best_blob->set_leader_on_left(true);
494
    #ifndef GRAPHICS_DISABLED
494
    if (leaders_win_ != NULL) {
495
    if (leaders_win_ != NULL) {
495
      leaders_win_->Pen(left_of_part ? ScrollView::RED : ScrollView::GREEN);
496
      leaders_win_->Pen(left_of_part ? ScrollView::RED : ScrollView::GREEN);
496
      const TBOX& blob_box = best_blob->bounding_box();
497
      const TBOX& blob_box = best_blob->bounding_box();
497
      leaders_win_->Rectangle(blob_box.left(), blob_box.bottom(),
498
      leaders_win_->Rectangle(blob_box.left(), blob_box.bottom(),
498
                              blob_box.right(), blob_box.top());
499
                              blob_box.right(), blob_box.top());
499
    }
500
    }
501
    #endif
500
  }
502
  }
501
}
503
}
(-)textord/colpartition.cpp (+2 lines)
Lines 1718-1723 Link Here
1718
  return copy;
1718
  return copy;
1719
}
1719
}
1720
1720
1721
#ifndef GRAPHICS_DISABLED
1721
// Provides a color for BBGrid to draw the rectangle.
1722
// Provides a color for BBGrid to draw the rectangle.
1722
// Must be kept in sync with PolyBlockType.
1723
// Must be kept in sync with PolyBlockType.
1723
ScrollView::Color  ColPartition::BoxColor() const {
1724
ScrollView::Color  ColPartition::BoxColor() const {
Lines 1725-1730 Link Here
1725
    return BLOBNBOX::TextlineColor(blob_type_, flow_);
1726
    return BLOBNBOX::TextlineColor(blob_type_, flow_);
1726
  return POLY_BLOCK::ColorForPolyBlockType(type_);
1727
  return POLY_BLOCK::ColorForPolyBlockType(type_);
1727
}
1728
}
1729
#endif  // GRAPHICS_DISABLED
1728
1730
1729
// Keep in sync with BlobRegionType.
1731
// Keep in sync with BlobRegionType.
1730
static char kBlobTypes[BRT_COUNT + 1] = "NHSRIUVT";
1732
static char kBlobTypes[BRT_COUNT + 1] = "NHSRIUVT";
(-)api/baseapi.cpp (+2 lines)
Lines 540-546 Link Here
540
  if (truth_cb_ != NULL) truth_cb_->Run(image_height_, page_res_);
540
  if (truth_cb_ != NULL) truth_cb_->Run(image_height_, page_res_);
541
541
542
  if (tesseract_->interactive_mode) {
542
  if (tesseract_->interactive_mode) {
543
    #ifndef GRAPHICS_DISABLED
543
    tesseract_->pgeditor_main(rect_width_, rect_height_, page_res_);
544
    tesseract_->pgeditor_main(rect_width_, rect_height_, page_res_);
545
    #endif
544
    // The page_res is invalid after an interactive session, so cleanup
546
    // The page_res is invalid after an interactive session, so cleanup
545
    // in a way that lets us continue to the next page without crashing.
547
    // in a way that lets us continue to the next page without crashing.
546
    delete page_res_;
548
    delete page_res_;
(-)training/mftraining.cpp (+4 lines)
Lines 107-112 Link Here
107
/*----------------------------------------------------------------------------
107
/*----------------------------------------------------------------------------
108
            Public Code
108
            Public Code
109
-----------------------------------------------------------------------------*/
109
-----------------------------------------------------------------------------*/
110
#ifndef GRAPHICS_DISABLED
110
void DisplayProtoList(const char* ch, LIST protolist) {
111
void DisplayProtoList(const char* ch, LIST protolist) {
111
  void* window = c_create_window("Char samples", 50, 200,
112
  void* window = c_create_window("Char samples", 50, 200,
112
                                 520, 520, -130.0, 130.0, -130.0, 130.0);
113
                                 520, 520, -130.0, 130.0, -130.0, 130.0);
Lines 116-121 Link Here
116
  }
117
  }
117
  c_make_current(window);
118
  c_make_current(window);
118
}
119
}
120
#endif  // GRAPHICS_DISABLED
119
121
120
// Helper to run clustering on a single config.
122
// Helper to run clustering on a single config.
121
// Mostly copied from the old mftraining, but with renamed variables.
123
// Mostly copied from the old mftraining, but with renamed variables.
Lines 306-313 Link Here
306
      // Merge.
307
      // Merge.
307
      MergeInsignificantProtos(ProtoList, CharSample->Label,
308
      MergeInsignificantProtos(ProtoList, CharSample->Label,
308
                               Clusterer, &Config);
309
                               Clusterer, &Config);
310
      #ifndef GRAPHICS_DISABLED
309
      if (strcmp(test_ch, CharSample->Label) == 0)
311
      if (strcmp(test_ch, CharSample->Label) == 0)
310
        DisplayProtoList(test_ch, ProtoList);
312
        DisplayProtoList(test_ch, ProtoList);
313
      #endif
311
      ProtoList = RemoveInsignificantProtos(ProtoList, true,
314
      ProtoList = RemoveInsignificantProtos(ProtoList, true,
312
                                            false,
315
                                            false,
313
                                            Clusterer->SampleSize);
316
                                            Clusterer->SampleSize);
(-)classify/adaptmatch.cpp (+6 lines)
Lines 228-233 Link Here
228
// Clears the window and draws baselines.
228
// Clears the window and draws baselines.
229
void Classify::RefreshDebugWindow(ScrollView **win, const char *msg,
229
void Classify::RefreshDebugWindow(ScrollView **win, const char *msg,
230
                                  int y_offset, const TBOX &wbox) {
230
                                  int y_offset, const TBOX &wbox) {
231
  #ifndef GRAPHICS_DISABLED
231
  const int kSampleSpaceWidth = 500;
232
  const int kSampleSpaceWidth = 500;
232
  if (*win == NULL) {
233
  if (*win == NULL) {
233
    *win = new ScrollView(msg, 100, y_offset, kSampleSpaceWidth * 2, 200,
234
    *win = new ScrollView(msg, 100, y_offset, kSampleSpaceWidth * 2, 200,
Lines 241-246 Link Here
241
               kSampleSpaceWidth, kBlnXHeight + kBlnBaselineOffset);
242
               kSampleSpaceWidth, kBlnXHeight + kBlnBaselineOffset);
242
  (*win)->ZoomToRectangle(wbox.left(), wbox.top(),
243
  (*win)->ZoomToRectangle(wbox.left(), wbox.top(),
243
                          wbox.right(), wbox.bottom());
244
                          wbox.right(), wbox.bottom());
245
  #endif  // GRAPHICS_DISABLED
244
}
246
}
245
247
246
// Learns the given word using its chopped_word, seam_array, denorm,
248
// Learns the given word using its chopped_word, seam_array, denorm,
Lines 276-281 Link Here
276
  int start_blob = 0;
278
  int start_blob = 0;
277
  char prev_map_char = '0';
279
  char prev_map_char = '0';
278
280
281
  #ifndef GRAPHICS_DISABLED
279
  if (classify_debug_character_fragments) {
282
  if (classify_debug_character_fragments) {
280
    if (learn_fragmented_word_debug_win_ != NULL) {
283
    if (learn_fragmented_word_debug_win_ != NULL) {
281
      window_wait(learn_fragmented_word_debug_win_);
284
      window_wait(learn_fragmented_word_debug_win_);
Lines 287-292 Link Here
287
    word->chopped_word->plot(learn_fragmented_word_debug_win_);
290
    word->chopped_word->plot(learn_fragmented_word_debug_win_);
288
    ScrollView::Update();
291
    ScrollView::Update();
289
  }
292
  }
293
  #endif  // GRAPHICS_DISABLED
290
294
291
  for (int ch = 0; ch < word_len; ++ch) {
295
  for (int ch = 0; ch < word_len; ++ch) {
292
    if (classify_debug_character_fragments) {
296
    if (classify_debug_character_fragments) {
Lines 410-415 Link Here
410
  if (rotated_blob == NULL)
414
  if (rotated_blob == NULL)
411
    rotated_blob = blob;
415
    rotated_blob = blob;
412
416
417
  #ifndef GRAPHICS_DISABLED
413
  // Draw debug windows showing the blob that is being learned if needed.
418
  // Draw debug windows showing the blob that is being learned if needed.
414
  if (strcmp(classify_learn_debug_str.string(), correct_text) == 0) {
419
  if (strcmp(classify_learn_debug_str.string(), correct_text) == 0) {
415
    RefreshDebugWindow(&learn_debug_win_, "LearnPieces", 600,
420
    RefreshDebugWindow(&learn_debug_win_, "LearnPieces", 600,
Lines 424-429 Link Here
424
               ScrollView::BLUE, ScrollView::BROWN);
429
               ScrollView::BLUE, ScrollView::BROWN);
425
    learn_fragments_debug_win_->Update();
430
    learn_fragments_debug_win_->Update();
426
  }
431
  }
432
  #endif  // GRAPHICS_DISABLED
427
433
428
  if (filename != NULL) {
434
  if (filename != NULL) {
429
    classify_norm_method.set_value(character);  // force char norm spc 30/11/93
435
    classify_norm_method.set_value(character);  // force char norm spc 30/11/93
(-)classify/intproto.cpp (-2 / +3 lines)
Lines 168-174 Link Here
168
                    INT_CLASS Class,
168
                    INT_CLASS Class,
169
                    PROTO_ID ProtoId,
169
                    PROTO_ID ProtoId,
170
                    ScrollView::Color color);
170
                    ScrollView::Color color);
171
#endif
171
#endif  // GRAPHICS_DISABLED
172
172
173
int TruncateParam(FLOAT32 Param, int Min, int Max, char *Id);
173
int TruncateParam(FLOAT32 Param, int Min, int Max, char *Id);
174
174
Lines 1942-1948 Link Here
1942
1942
1943
1943
1944
/*---------------------------------------------------------------------------*/
1944
/*---------------------------------------------------------------------------*/
1945
1945
#ifndef GRAPHICS_DISABLED
1946
/**
1946
/**
1947
 * Initializes the int matcher window if it is not already
1947
 * Initializes the int matcher window if it is not already
1948
 * initialized.
1948
 * initialized.
Lines 1991-1993 Link Here
1991
ScrollView* CreateFeatureSpaceWindow(const char* name, int xpos, int ypos) {
1991
ScrollView* CreateFeatureSpaceWindow(const char* name, int xpos, int ypos) {
1992
  return new ScrollView(name, xpos, ypos, 520, 520, 260, 260, true);
1992
  return new ScrollView(name, xpos, ypos, 520, 520, 260, 260, true);
1993
}
1993
}
1994
#endif  // GRAPHICS_DISABLED
(-)classify/intproto.h (+2 lines)
Lines 239-244 Link Here
239
}  // namespace tesseract.
239
}  // namespace tesseract.
240
240
241
/*----------------------------------------------------------------------------*/
241
/*----------------------------------------------------------------------------*/
242
#ifndef GRAPHICS_DISABLED
242
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT* Feature,
243
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT* Feature,
243
                      ScrollView::Color color);
244
                      ScrollView::Color color);
244
245
Lines 251-255 Link Here
251
// Creates a window of the appropriate size for displaying elements
252
// Creates a window of the appropriate size for displaying elements
252
// in feature space.
253
// in feature space.
253
ScrollView* CreateFeatureSpaceWindow(const char* name, int xpos, int ypos);
254
ScrollView* CreateFeatureSpaceWindow(const char* name, int xpos, int ypos);
255
#endif  // GRAPHICS_DISABLED
254
256
255
#endif
257
#endif

Return to bug 343211