Tesseract  3.02
tesseract-ocr/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 #include "mfcpch.h"
00021 #include          "drawfx.h"
00022 #include          "normalis.h"
00023 #include          "werd.h"
00024 
00025 // Include automatically generated configuration file if running autoconf.
00026 #ifdef HAVE_CONFIG_H
00027 #include "config_auto.h"
00028 #endif
00029 
00030 #ifndef GRAPHICS_DISABLED
00031 #define FXDEMOWIN     "FXDemo"
00032 #define FXDEMOXPOS      250
00033 #define FXDEMOYPOS      0
00034 #define FXDEMOXSIZE     600
00035 #define FXDEMOYSIZE     256
00036 #define BLN_MAX       512        //max coord for bln
00037 #define WERDWIDTH       (BLN_MAX*20)
00038 #define DECENT_WERD_WIDTH (5*kBlnXHeight)
00039                                  //title of window
00040 #define DEBUG_WIN_NAME    "FXDebug"
00041 #define DEBUG_XPOS      0
00042 #define DEBUG_YPOS      120
00043 #define DEBUG_XSIZE     80
00044 #define DEBUG_YSIZE     32
00045 #define YMAX        3508
00046 #define XMAX        2550
00047 #define MAXEDGELENGTH   1024     //max steps inoutline
00048 
00049 #define EXTERN
00050 
00051 EXTERN STRING_VAR (fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile");
00052 
00053 EXTERN ScrollView* fx_win = NULL;
00054 EXTERN FILE *fx_debug = NULL;
00055 
00056 /**********************************************************************
00057  * create_fx_win
00058  *
00059  * Create the fx window used to show the fit.
00060  **********************************************************************/
00061 
00062 void create_fx_win() {  //make features win
00063   fx_win = new ScrollView (FXDEMOWIN,
00064     FXDEMOXPOS, FXDEMOYPOS, FXDEMOXSIZE, FXDEMOYSIZE,
00065     WERDWIDTH*2, BLN_MAX*2, true);
00066 }
00067 
00068 
00069 /**********************************************************************
00070  * clear_fx_win
00071  *
00072  * Clear the fx window and draw on the base/mean lines.
00073  **********************************************************************/
00074 
00075 void clear_fx_win() {  //make features win
00076   fx_win->Clear();
00077   fx_win->Pen(64,64,64);
00078   fx_win->Line(-WERDWIDTH, kBlnBaselineOffset, WERDWIDTH, kBlnBaselineOffset);
00079   fx_win->Line(-WERDWIDTH, kBlnXHeight + kBlnBaselineOffset, WERDWIDTH,
00080                kBlnXHeight + kBlnBaselineOffset);
00081 }
00082 
00083 #endif  // GRAPHICS_DISABLED
00084 
00085 /**********************************************************************
00086  * create_fxdebug_win
00087  *
00088  * Create the fx window used to show the fit.
00089  **********************************************************************/
00090 
00091 void create_fxdebug_win() {  //make gradients win
00092 }