/** * bln_word_window_handle() * * @return a WINDOW for the word window, creating it if necessary */ ScrollView* bln_word_window_handle() { // return handle // not opened yet if (bln_word_window == NULL) { pgeditor_msg("Creating BLN word window..."); bln_word_window = new ScrollView(editor_word_name.string(), editor_word_xpos, editor_word_ypos, editor_word_width, editor_word_height, 4000, 4000, true); BlnEventHandler* a = new BlnEventHandler(); bln_word_window->AddEventHandler(a); pgeditor_msg("Creating BLN word window...Done"); } return bln_word_window; }
WINDOW display_clip_image(WERD *word, //word to be processed IMAGE &bin_image, //whole image PIXROW_LIST *pixrow_list, //pixrows built BOX &pix_box //box of subimage ) { WINDOW clip_window; //window for debug BOX word_box = word->bounding_box (); int border = word_box.height () / 2; BOX display_box = word_box; display_box.move_bottom_edge (-border); display_box.move_top_edge (border); display_box.move_left_edge (-border); display_box.move_right_edge (border); display_box -= BOX (ICOORD (0, 0 - BUG_OFFSET), ICOORD (bin_image.get_xsize (), bin_image.get_ysize () - BUG_OFFSET)); pgeditor_msg ("Creating Clip window..."); clip_window = create_window ("Clipped Blobs", SCROLLINGWIN, editor_word_xpos, editor_word_ypos, 3 * (word_box.width () + 2 * border), 3 * (word_box.height () + 2 * border), //window width,height // xmin, xmax display_box.left (), display_box.right (), display_box.bottom () - BUG_OFFSET, display_box.top () - BUG_OFFSET, // ymin, ymax TRUE, FALSE, FALSE, TRUE); // down event & key only pgeditor_msg ("Creating Clip window...Done"); clear_view_surface(clip_window); show_sub_image (&bin_image, display_box.left (), display_box.bottom (), display_box.width (), display_box.height (), clip_window, display_box.left (), display_box.bottom () - BUG_OFFSET); word->plot (clip_window, RED); word_box.plot (clip_window, INT_HOLLOW, TRUE, BLUE, BLUE); pix_box.plot (clip_window, INT_HOLLOW, TRUE, BLUE, BLUE); plot_pixrows(pixrow_list, clip_window); overlap_picture_ops(TRUE); return clip_window; }
ScrollView* display_clip_image(WERD *word, //word to be processed IMAGE &bin_image, //whole image PIXROW_LIST *pixrow_list, //pixrows built TBOX &pix_box //box of subimage ) { ScrollView* clip_window; //window for debug TBOX word_box = word->bounding_box (); int border = word_box.height () / 2; TBOX display_box = word_box; display_box.move_bottom_edge (-border); display_box.move_top_edge (border); display_box.move_left_edge (-border); display_box.move_right_edge (border); display_box -= TBOX (ICOORD (0, 0 - BUG_OFFSET), ICOORD (bin_image.get_xsize (), bin_image.get_ysize () - BUG_OFFSET)); pgeditor_msg ("Creating Clip window..."); clip_window = new ScrollView("Clipped Blobs", editor_word_xpos, editor_word_ypos, 3 * (word_box.width () + 2 * border), 3 * (word_box.height () + 2 * border), display_box.left () + display_box.right (), display_box.bottom () - BUG_OFFSET + display_box.top () - BUG_OFFSET, true); // ymin, ymax pgeditor_msg ("Creating Clip window...Done"); clip_window->Clear(); sv_show_sub_image (&bin_image, display_box.left (), display_box.bottom (), display_box.width (), display_box.height (), clip_window, display_box.left (), display_box.bottom () - BUG_OFFSET); word->plot (clip_window, ScrollView::RED); word_box.plot (clip_window, ScrollView::BLUE, ScrollView::BLUE); pix_box.plot (clip_window, ScrollView::BLUE, ScrollView::BLUE); plot_pixrows(pixrow_list, clip_window); return clip_window; }