Tesseract 3.01
/data/source/tesseract-ocr/ccmain/pgedit.cpp File Reference
#include "pgedit.h"
#include <ctype.h>
#include <math.h>
#include "tordmain.h"
#include "statistc.h"
#include "svshowim.h"
#include "paramsd.h"
#include "string.h"
#include "scrollview.h"
#include "svmnode.h"
#include "control.h"
#include "tesseractclass.h"
#include "blread.h"

Classes

class  BlnEventHandler

Namespaces

namespace  tesseract

Defines

#define ASC_HEIGHT   (2 * kBlnBaselineOffset + kBlnXHeight)
#define X_HEIGHT   (kBlnBaselineOffset + kBlnXHeight)
#define BL_HEIGHT   kBlnBaselineOffset
#define DESC_HEIGHT   0
#define MAXSPACING   128

Enumerations

enum  CMD_EVENTS {
  NULL_CMD_EVENT, CHANGE_DISP_CMD_EVENT, DUMP_WERD_CMD_EVENT, SHOW_POINT_CMD_EVENT,
  SHOW_BLN_WERD_CMD_EVENT, DEBUG_WERD_CMD_EVENT, BOUNDING_BOX_CMD_EVENT, CORRECT_TEXT_CMD_EVENT,
  POLYGONAL_CMD_EVENT, BL_NORM_CMD_EVENT, BITMAP_CMD_EVENT, IMAGE_CMD_EVENT,
  BLOCKS_CMD_EVENT, BASELINES_CMD_EVENT, UNIFORM_DISP_CMD_EVENT, REFRESH_CMD_EVENT,
  QUIT_CMD_EVENT, RECOG_WERDS, RECOG_PSEUDO, SHOW_SUBSCRIPT_CMD_EVENT,
  SHOW_SUPERSCRIPT_CMD_EVENT, SHOW_ITALIC_CMD_EVENT, SHOW_BOLD_CMD_EVENT, SHOW_UNDERLINE_CMD_EVENT,
  SHOW_FIXEDPITCH_CMD_EVENT, SHOW_SERIF_CMD_EVENT, SHOW_SMALLCAPS_CMD_EVENT, SHOW_DROPCAPS_CMD_EVENT
}
enum  ColorationMode {
  CM_RAINBOW, CM_SUBSCRIPT, CM_SUPERSCRIPT, CM_ITALIC,
  CM_BOLD, CM_UNDERLINE, CM_FIXEDPITCH, CM_SERIF,
  CM_SMALLCAPS, CM_DROPCAPS
}

Functions

ScrollViewbln_word_window_handle ()
void build_image_window (int width, int height)
void display_bln_lines (ScrollView *window, ScrollView::Color colour, float scale_factor, float y_offset, float minx, float maxx)
void pgeditor_msg (const char *msg)
void pgeditor_show_point (SVEvent *event)
void show_point (PAGE_RES *page_res, float x, float y)

Variables

const ERRCODE EMPTYBLOCKLIST = "No blocks to edit"
ScrollViewimage_win
ParamsEditorpe
bool stillRunning = false
ScrollViewbln_word_window = NULL
CMD_EVENTS mode = CHANGE_DISP_CMD_EVENT
BITS16 word_display_mode
BOOL8 display_image = FALSE
BOOL8 display_blocks = FALSE
BOOL8 display_baselines = FALSE
PAGE_REScurrent_page_res = NULL
char * editor_image_win_name = "EditorImage"
int editor_image_xpos = 590
int editor_image_ypos = 10
int editor_image_menuheight = 50
int editor_image_word_bb_color = ScrollView::BLUE
int editor_image_blob_bb_color = ScrollView::YELLOW
int editor_image_text_color = ScrollView::WHITE
char * editor_dbwin_name = "EditorDBWin"
int editor_dbwin_xpos = 50
int editor_dbwin_ypos = 500
int editor_dbwin_height = 24
int editor_dbwin_width = 80
char * editor_word_name = "BlnWords"
int editor_word_xpos = 60
int editor_word_ypos = 510
int editor_word_height = 240
int editor_word_width = 655
char * editor_debug_config_file = ""

Define Documentation

#define ASC_HEIGHT   (2 * kBlnBaselineOffset + kBlnXHeight)
#define BL_HEIGHT   kBlnBaselineOffset
#define DESC_HEIGHT   0
#define MAXSPACING   128
#define X_HEIGHT   (kBlnBaselineOffset + kBlnXHeight)

Enumeration Type Documentation

enum CMD_EVENTS
Enumerator:
NULL_CMD_EVENT 
CHANGE_DISP_CMD_EVENT 
DUMP_WERD_CMD_EVENT 
SHOW_POINT_CMD_EVENT 
SHOW_BLN_WERD_CMD_EVENT 
DEBUG_WERD_CMD_EVENT 
BOUNDING_BOX_CMD_EVENT 
CORRECT_TEXT_CMD_EVENT 
POLYGONAL_CMD_EVENT 
BL_NORM_CMD_EVENT 
BITMAP_CMD_EVENT 
IMAGE_CMD_EVENT 
BLOCKS_CMD_EVENT 
BASELINES_CMD_EVENT 
UNIFORM_DISP_CMD_EVENT 
REFRESH_CMD_EVENT 
QUIT_CMD_EVENT 
RECOG_WERDS 
RECOG_PSEUDO 
SHOW_SUBSCRIPT_CMD_EVENT 
SHOW_SUPERSCRIPT_CMD_EVENT 
SHOW_ITALIC_CMD_EVENT 
SHOW_BOLD_CMD_EVENT 
SHOW_UNDERLINE_CMD_EVENT 
SHOW_FIXEDPITCH_CMD_EVENT 
SHOW_SERIF_CMD_EVENT 
SHOW_SMALLCAPS_CMD_EVENT 
SHOW_DROPCAPS_CMD_EVENT 
Enumerator:
CM_RAINBOW 
CM_SUBSCRIPT 
CM_SUPERSCRIPT 
CM_ITALIC 
CM_BOLD 
CM_UNDERLINE 
CM_FIXEDPITCH 
CM_SERIF 
CM_SMALLCAPS 
CM_DROPCAPS 

Function Documentation

ScrollView* bln_word_window_handle ( )

bln_word_window_handle()

Returns:
a WINDOW for the word window, creating it if necessary
void build_image_window ( int  width,
int  height 
)

build_image_window()

Destroy the existing image window if there is one. Work out how big the new window needs to be. Create it and re-display.

void display_bln_lines ( ScrollView window,
ScrollView::Color  colour,
float  scale_factor,
float  y_offset,
float  minx,
float  maxx 
)

display_bln_lines()

Display normalized baseline, x-height, ascender limit and descender limit

void pgeditor_msg ( const char *  msg)

pgeditor_msg()

Display a message - in the command window if there is one, or to stdout

void pgeditor_show_point ( SVEvent event)

pgeditor_show_point()

Display the coordinates of a point in the command window

void show_point ( PAGE_RES page_res,
float  x,
float  y 
)

show_point()

Show coords of point, blob bounding box, word bounding box and offset from row baseline


Variable Documentation

"Editor debug window height"

char* editor_dbwin_name = "EditorDBWin"

"Editor debug window name"

"Editor debug window width"

"Editor debug window X Pos"

int editor_dbwin_ypos = 500

"Editor debug window Y Pos"

"Config file to apply to single words"

int editor_image_blob_bb_color = ScrollView::YELLOW

"Blob bounding box colour"

"Add to image height for menu bar"

int editor_image_text_color = ScrollView::WHITE

"Correct text colour"

char* editor_image_win_name = "EditorImage"

"Editor image window name"

int editor_image_word_bb_color = ScrollView::BLUE

"Word bounding box colour"

int editor_image_xpos = 590

"Editor image X Pos"

"Editor image Y Pos"

int editor_word_height = 240

"Word window height"

char* editor_word_name = "BlnWords"

"BL normalized word window"

int editor_word_width = 655

"Word window width"

int editor_word_xpos = 60

"Word window X Pos"

int editor_word_ypos = 510

"Word window Y Pos"

const ERRCODE EMPTYBLOCKLIST = "No blocks to edit"
CMD_EVENTS mode = CHANGE_DISP_CMD_EVENT
bool stillRunning = false
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines