tesseract
v5.3.3.20231005
drawfx.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
* File: drawfx.cpp
3
* Description: Draw things to do with feature extraction.
4
* Author: Ray Smith
5
*
6
* (C) Copyright 1992, Hewlett-Packard Ltd.
7
** Licensed under the Apache License, Version 2.0 (the "License");
8
** you may not use this file except in compliance with the License.
9
** You may obtain a copy of the License at
10
** http://www.apache.org/licenses/LICENSE-2.0
11
** Unless required by applicable law or agreed to in writing, software
12
** distributed under the License is distributed on an "AS IS" BASIS,
13
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
** See the License for the specific language governing permissions and
15
** limitations under the License.
16
*
17
**********************************************************************/
18
19
#ifdef HAVE_CONFIG_H
20
# include "config_auto.h"
21
#endif
22
23
#include "
drawfx.h
"
24
25
#include "
normalis.h
"
26
#include "
werd.h
"
27
28
namespace
tesseract
{
29
30
#ifndef GRAPHICS_DISABLED
31
32
# define FXDEMOWIN "FXDemo"
33
# define FXDEMOXPOS 250
34
# define FXDEMOYPOS 0
35
# define FXDEMOXSIZE 600
36
# define FXDEMOYSIZE 256
37
# define BLN_MAX 512
// max coord for bln
38
# define WERDWIDTH (BLN_MAX * 20)
39
// title of window
40
# define DEBUG_WIN_NAME "FXDebug"
41
42
ScrollView
*
fx_win
=
nullptr
;
43
44
/**********************************************************************
45
* create_fx_win
46
*
47
* Create the fx window used to show the fit.
48
**********************************************************************/
49
50
void
create_fx_win
() {
// make features win
51
fx_win
=
new
ScrollView
(
FXDEMOWIN
,
FXDEMOXPOS
,
FXDEMOYPOS
,
FXDEMOXSIZE
,
FXDEMOYSIZE
,
52
WERDWIDTH
* 2,
BLN_MAX
* 2,
true
);
53
}
54
55
/**********************************************************************
56
* clear_fx_win
57
*
58
* Clear the fx window and draw on the base/mean lines.
59
**********************************************************************/
60
61
void
clear_fx_win
() {
// make features win
62
fx_win
->
Clear
();
63
fx_win
->
Pen
(64, 64, 64);
64
fx_win
->
Line
(-
WERDWIDTH
,
kBlnBaselineOffset
,
WERDWIDTH
,
kBlnBaselineOffset
);
65
fx_win
->
Line
(-
WERDWIDTH
,
kBlnXHeight
+
kBlnBaselineOffset
,
WERDWIDTH
,
66
kBlnXHeight
+
kBlnBaselineOffset
);
67
}
68
69
#endif
// !GRAPHICS_DISABLED
70
71
/**********************************************************************
72
* create_fxdebug_win
73
*
74
* Create the fx window used to show the fit.
75
**********************************************************************/
76
77
void
create_fxdebug_win
() {
// make gradients win
78
}
79
80
}
// namespace tesseract
drawfx.h
WERDWIDTH
#define WERDWIDTH
Definition:
drawfx.cpp:38
FXDEMOYSIZE
#define FXDEMOYSIZE
Definition:
drawfx.cpp:36
FXDEMOWIN
#define FXDEMOWIN
Definition:
drawfx.cpp:32
FXDEMOXSIZE
#define FXDEMOXSIZE
Definition:
drawfx.cpp:35
FXDEMOXPOS
#define FXDEMOXPOS
Definition:
drawfx.cpp:33
BLN_MAX
#define BLN_MAX
Definition:
drawfx.cpp:37
FXDEMOYPOS
#define FXDEMOYPOS
Definition:
drawfx.cpp:34
normalis.h
werd.h
tesseract
Definition:
baseapi.h:39
tesseract::clear_fx_win
void clear_fx_win()
Definition:
drawfx.cpp:61
tesseract::kBlnXHeight
const int kBlnXHeight
Definition:
normalis.h:33
tesseract::create_fx_win
void create_fx_win()
Definition:
drawfx.cpp:50
tesseract::create_fxdebug_win
void create_fxdebug_win()
Definition:
drawfx.cpp:77
tesseract::fx_win
ScrollView * fx_win
Definition:
drawfx.cpp:42
tesseract::kBlnBaselineOffset
const int kBlnBaselineOffset
Definition:
normalis.h:34
tesseract::ScrollView
Definition:
scrollview.h:109
tesseract::ScrollView::Line
void Line(int x1, int y1, int x2, int y2)
Definition:
scrollview.cpp:498
tesseract::ScrollView::Clear
void Clear()
Definition:
scrollview.cpp:565
tesseract::ScrollView::Pen
void Pen(Color color)
Definition:
scrollview.cpp:710
src
wordrec
drawfx.cpp
Generated on Thu Oct 5 2023 22:10:27 for tesseract by
1.9.4