tesseract
4.1.1
protos.h
Go to the documentation of this file.
1
/* -*-C-*-
2
******************************************************************************
3
*
4
* File: protos.h
5
* Author: Mark Seaman, SW Productivity
6
*
7
* (c) Copyright 1987, Hewlett-Packard Company.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
*
18
*****************************************************************************/
19
20
#ifndef PROTOS_H
21
#define PROTOS_H
22
23
/*----------------------------------------------------------------------
24
I n c l u d e s
25
----------------------------------------------------------------------*/
26
#include "
bitvec.h
"
27
#include "
params.h
"
28
#include "
unichar.h
"
29
#include "
unicity_table.h
"
30
31
/*----------------------------------------------------------------------
32
T y p e s
33
----------------------------------------------------------------------*/
34
using
CONFIGS
=
BIT_VECTOR
*;
35
36
typedef
struct
{
37
float
A
;
38
float
B
;
39
float
C
;
40
float
X
;
41
float
Y
;
42
float
Angle
;
43
float
Length
;
44
}
PROTO_STRUCT
;
45
using
PROTO
=
PROTO_STRUCT
*;
46
47
struct
CLASS_STRUCT
{
48
CLASS_STRUCT
()
49
:
NumProtos
(0),
50
MaxNumProtos
(0),
51
Prototypes
(nullptr),
52
NumConfigs
(0),
53
MaxNumConfigs
(0),
54
Configurations
(nullptr) {}
55
int16_t
NumProtos
;
56
int16_t
MaxNumProtos
;
57
PROTO
Prototypes
;
58
int16_t
NumConfigs
;
59
int16_t
MaxNumConfigs
;
60
CONFIGS
Configurations
;
61
UnicityTableEqEq<int>
font_set
;
62
};
63
using
CLASS_TYPE
=
CLASS_STRUCT
*;
64
using
CLASSES
=
CLASS_STRUCT
*;
65
66
/*----------------------------------------------------------------------
67
M a c r o s
68
----------------------------------------------------------------------*/
75
#define AddProtoToConfig(Pid, Config) (SET_BIT(Config, Pid))
76
84
#define ProtoIn(Class, Pid) (&(Class)->Prototypes[Pid])
85
86
/*----------------------------------------------------------------------
87
F u n c t i o n s
88
----------------------------------------------------------------------*/
89
int
AddConfigToClass
(
CLASS_TYPE
Class);
90
91
int
AddProtoToClass
(
CLASS_TYPE
Class);
92
93
void
FillABC
(
PROTO
Proto);
94
95
void
FreeClass
(
CLASS_TYPE
Class);
96
97
void
FreeClassFields
(
CLASS_TYPE
Class);
98
99
void
InitPrototypes
();
100
101
CLASS_TYPE
NewClass
(
int
NumProtos,
int
NumConfigs);
102
103
#endif
PROTO_STRUCT::C
float C
Definition:
protos.h:39
AddConfigToClass
int AddConfigToClass(CLASS_TYPE Class)
Definition:
protos.cpp:47
InitPrototypes
void InitPrototypes()
BIT_VECTOR
uint32_t * BIT_VECTOR
Definition:
bitvec.h:28
bitvec.h
CLASS_STRUCT::Prototypes
PROTO Prototypes
Definition:
protos.h:57
AddProtoToClass
int AddProtoToClass(CLASS_TYPE Class)
Definition:
protos.cpp:84
unicity_table.h
CLASS_STRUCT::CLASS_STRUCT
CLASS_STRUCT()
Definition:
protos.h:48
PROTO_STRUCT::Y
float Y
Definition:
protos.h:41
CLASS_STRUCT::MaxNumProtos
int16_t MaxNumProtos
Definition:
protos.h:56
PROTO_STRUCT::Length
float Length
Definition:
protos.h:43
FreeClassFields
void FreeClassFields(CLASS_TYPE Class)
Definition:
protos.cpp:138
CLASS_STRUCT::Configurations
CONFIGS Configurations
Definition:
protos.h:60
PROTO_STRUCT::B
float B
Definition:
protos.h:38
unichar.h
CLASS_STRUCT::font_set
UnicityTableEqEq< int > font_set
Definition:
protos.h:61
PROTO_STRUCT::X
float X
Definition:
protos.h:40
FreeClass
void FreeClass(CLASS_TYPE Class)
Definition:
protos.cpp:125
CLASS_STRUCT::MaxNumConfigs
int16_t MaxNumConfigs
Definition:
protos.h:59
FillABC
void FillABC(PROTO Proto)
Definition:
protos.cpp:108
CLASS_STRUCT
Definition:
protos.h:47
CONFIGS
BIT_VECTOR * CONFIGS
Definition:
protos.h:34
PROTO_STRUCT::A
float A
Definition:
protos.h:37
CLASS_STRUCT::NumConfigs
int16_t NumConfigs
Definition:
protos.h:58
PROTO_STRUCT
Definition:
protos.h:36
CLASS_STRUCT::NumProtos
int16_t NumProtos
Definition:
protos.h:55
UnicityTableEqEq< int >
params.h
NewClass
CLASS_TYPE NewClass(int NumProtos, int NumConfigs)
Definition:
protos.cpp:157
PROTO_STRUCT::Angle
float Angle
Definition:
protos.h:42
src
classify
protos.h
Generated on Thu Mar 26 2020 00:00:00 for tesseract by
1.8.18