Tesseract
3.02
|
00001 00002 // File: pgedit.h 00003 // Description: Page structure file editor 00004 // Author: Joern Wanke 00005 // Created: Wed Jul 18 10:05:01 PDT 2007 00006 // 00007 // (C) Copyright 2007, Google Inc. 00008 // Licensed under the Apache License, Version 2.0 (the "License"); 00009 // you may not use this file except in compliance with the License. 00010 // You may obtain a copy of the License at 00011 // http://www.apache.org/licenses/LICENSE-2.0 00012 // Unless required by applicable law or agreed to in writing, software 00013 // distributed under the License is distributed on an "AS IS" BASIS, 00014 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 // See the License for the specific language governing permissions and 00016 // limitations under the License. 00017 // 00019 00020 #ifndef PGEDIT_H 00021 #define PGEDIT_H 00022 00023 #include "ocrblock.h" 00024 #include "ocrrow.h" 00025 #include "werd.h" 00026 #include "rect.h" 00027 #include "params.h" 00028 #include "notdll.h" 00029 #include "tesseractclass.h" 00030 00031 class ScrollView; 00032 class SVMenuNode; 00033 struct SVEvent; 00034 00035 // A small event handler class to process incoming events to 00036 // this window. 00037 class PGEventHandler : public SVEventHandler { 00038 public: 00039 PGEventHandler(tesseract::Tesseract* tess) : tess_(tess) { 00040 } 00041 void Notify(const SVEvent* sve); 00042 private: 00043 tesseract::Tesseract* tess_; 00044 }; 00045 00046 extern BLOCK_LIST *current_block_list; 00047 extern STRING_VAR_H (editor_image_win_name, "EditorImage", 00048 "Editor image window name"); 00049 extern INT_VAR_H (editor_image_xpos, 590, "Editor image X Pos"); 00050 extern INT_VAR_H (editor_image_ypos, 10, "Editor image Y Pos"); 00051 extern INT_VAR_H (editor_image_height, 680, "Editor image height"); 00052 extern INT_VAR_H (editor_image_width, 655, "Editor image width"); 00053 extern INT_VAR_H (editor_image_word_bb_color, BLUE, 00054 "Word bounding box colour"); 00055 extern INT_VAR_H (editor_image_blob_bb_color, YELLOW, 00056 "Blob bounding box colour"); 00057 extern INT_VAR_H (editor_image_text_color, WHITE, "Correct text colour"); 00058 extern STRING_VAR_H (editor_dbwin_name, "EditorDBWin", 00059 "Editor debug window name"); 00060 extern INT_VAR_H (editor_dbwin_xpos, 50, "Editor debug window X Pos"); 00061 extern INT_VAR_H (editor_dbwin_ypos, 500, "Editor debug window Y Pos"); 00062 extern INT_VAR_H (editor_dbwin_height, 24, "Editor debug window height"); 00063 extern INT_VAR_H (editor_dbwin_width, 80, "Editor debug window width"); 00064 extern STRING_VAR_H (editor_word_name, "BlnWords", 00065 "BL normalised word window"); 00066 extern INT_VAR_H (editor_word_xpos, 60, "Word window X Pos"); 00067 extern INT_VAR_H (editor_word_ypos, 510, "Word window Y Pos"); 00068 extern INT_VAR_H (editor_word_height, 240, "Word window height"); 00069 extern INT_VAR_H (editor_word_width, 655, "Word window width"); 00070 extern double_VAR_H (editor_smd_scale_factor, 1.0, "Scaling for smd image"); 00071 00072 ScrollView* bln_word_window_handle(); //return handle 00073 void build_image_window(int width, int height); 00074 void display_bln_lines(ScrollView window, 00075 ScrollView::Color colour, 00076 float scale_factor, 00077 float y_offset, 00078 float minx, 00079 float maxx); 00080 //function to call 00081 void pgeditor_msg( //message display 00082 const char *msg); 00083 void pgeditor_show_point( //display coords 00084 SVEvent *event); 00085 //put bln word in box 00086 void show_point(PAGE_RES* page_res, float x, float y); 00087 00088 #endif