tesseract  3.03
/usr/local/google/home/jbreiden/tesseract-ocr-read-only/wordrec/drawfx.cpp
Go to the documentation of this file.
00001 /**********************************************************************
00002  * File:        drawfx.cpp  (Formerly drawfx.c)
00003  * Description: Draw things to do with feature extraction.
00004  * Author:              Ray Smith
00005  * Created:             Mon Jan 27 11:02:16 GMT 1992
00006  *
00007  * (C) Copyright 1992, Hewlett-Packard Ltd.
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  *
00018  **********************************************************************/
00019 
00020 #ifdef HAVE_CONFIG_H
00021 #include "config_auto.h"
00022 #endif
00023 
00024 #include          "drawfx.h"
00025 #include          "normalis.h"
00026 #include          "werd.h"
00027 
00028 #ifndef GRAPHICS_DISABLED
00029 #define FXDEMOWIN     "FXDemo"
00030 #define FXDEMOXPOS      250
00031 #define FXDEMOYPOS      0
00032 #define FXDEMOXSIZE     600
00033 #define FXDEMOYSIZE     256
00034 #define BLN_MAX       512        //max coord for bln
00035 #define WERDWIDTH       (BLN_MAX*20)
00036 #define DECENT_WERD_WIDTH (5*kBlnXHeight)
00037                                  //title of window
00038 #define DEBUG_WIN_NAME    "FXDebug"
00039 #define DEBUG_XPOS      0
00040 #define DEBUG_YPOS      120
00041 #define DEBUG_XSIZE     80
00042 #define DEBUG_YSIZE     32
00043 #define YMAX        3508
00044 #define XMAX        2550
00045 #define MAXEDGELENGTH   1024     //max steps inoutline
00046 
00047 #define EXTERN
00048 
00049 EXTERN STRING_VAR (fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile");
00050 
00051 EXTERN ScrollView* fx_win = NULL;
00052 EXTERN FILE *fx_debug = NULL;
00053 
00054 /**********************************************************************
00055  * create_fx_win
00056  *
00057  * Create the fx window used to show the fit.
00058  **********************************************************************/
00059 
00060 void create_fx_win() {  //make features win
00061   fx_win = new ScrollView (FXDEMOWIN,
00062     FXDEMOXPOS, FXDEMOYPOS, FXDEMOXSIZE, FXDEMOYSIZE,
00063     WERDWIDTH*2, BLN_MAX*2, true);
00064 }
00065 
00066 
00067 /**********************************************************************
00068  * clear_fx_win
00069  *
00070  * Clear the fx window and draw on the base/mean lines.
00071  **********************************************************************/
00072 
00073 void clear_fx_win() {  //make features win
00074   fx_win->Clear();
00075   fx_win->Pen(64,64,64);
00076   fx_win->Line(-WERDWIDTH, kBlnBaselineOffset, WERDWIDTH, kBlnBaselineOffset);
00077   fx_win->Line(-WERDWIDTH, kBlnXHeight + kBlnBaselineOffset, WERDWIDTH,
00078                kBlnXHeight + kBlnBaselineOffset);
00079 }
00080 
00081 #endif  // GRAPHICS_DISABLED
00082 
00083 /**********************************************************************
00084  * create_fxdebug_win
00085  *
00086  * Create the fx window used to show the fit.
00087  **********************************************************************/
00088 
00089 void create_fxdebug_win() {  //make gradients win
00090 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines