tesseract 4.1.1
Loading...
Searching...
No Matches
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----------------------------------------------------------------------*/
35
36typedef struct {
37 float A;
38 float B;
39 float C;
40 float X;
41 float Y;
42 float Angle;
43 float Length;
46
49 : NumProtos(0),
50 MaxNumProtos(0),
51 Prototypes(nullptr),
52 NumConfigs(0),
54 Configurations(nullptr) {}
55 int16_t NumProtos;
56 int16_t MaxNumProtos;
58 int16_t NumConfigs;
62};
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----------------------------------------------------------------------*/
90
92
93void FillABC(PROTO Proto);
94
95void FreeClass(CLASS_TYPE Class);
96
97void FreeClassFields(CLASS_TYPE Class);
98
100
101CLASS_TYPE NewClass(int NumProtos, int NumConfigs);
102
103#endif
void FreeClass(CLASS_TYPE Class)
Definition: protos.cpp:125
int AddProtoToClass(CLASS_TYPE Class)
Definition: protos.cpp:84
void FreeClassFields(CLASS_TYPE Class)
Definition: protos.cpp:138
int AddConfigToClass(CLASS_TYPE Class)
Definition: protos.cpp:47
void FillABC(PROTO Proto)
Definition: protos.cpp:108
BIT_VECTOR * CONFIGS
Definition: protos.h:34
void InitPrototypes()
CLASS_TYPE NewClass(int NumProtos, int NumConfigs)
Definition: protos.cpp:157
uint32_t * BIT_VECTOR
Definition: bitvec.h:28
float Angle
Definition: protos.h:42
float Length
Definition: protos.h:43
float Y
Definition: protos.h:41
float B
Definition: protos.h:38
float A
Definition: protos.h:37
float C
Definition: protos.h:39
float X
Definition: protos.h:40
int16_t NumConfigs
Definition: protos.h:58
int16_t NumProtos
Definition: protos.h:55
UnicityTableEqEq< int > font_set
Definition: protos.h:61
CLASS_STRUCT()
Definition: protos.h:48
CONFIGS Configurations
Definition: protos.h:60
int16_t MaxNumProtos
Definition: protos.h:56
int16_t MaxNumConfigs
Definition: protos.h:59
PROTO Prototypes
Definition: protos.h:57