Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
states.h
Go to the documentation of this file.
1 /* -*-C-*-
2  ********************************************************************************
3  *
4  * File: states.h (Formerly states.h)
5  * Description: Representations of search states
6  * Author: Mark Seaman, OCR Technology
7  * Created: Wed May 16 15:52:40 1990
8  * Modified: Tue May 21 16:26:21 1991 (Mark Seaman) marks@hpgrlt
9  * Language: C
10  * Package: N/A
11  * Status: Experimental (Do Not Distribute)
12  *
13  * (c) Copyright 1990, Hewlett-Packard Company.
14  ** Licensed under the Apache License, Version 2.0 (the "License");
15  ** you may not use this file except in compliance with the License.
16  ** You may obtain a copy of the License at
17  ** http://www.apache.org/licenses/LICENSE-2.0
18  ** Unless required by applicable law or agreed to in writing, software
19  ** distributed under the License is distributed on an "AS IS" BASIS,
20  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  ** See the License for the specific language governing permissions and
22  ** limitations under the License.
23  *
24  *********************************************************************************/
25 #ifndef STATES_H
26 #define STATES_H
27 
28 /*----------------------------------------------------------------------
29  I n c l u d e s
30 ----------------------------------------------------------------------*/
31 #include "host.h"
32 #include "strngs.h"
33 
34 /*----------------------------------------------------------------------
35  T y p e s
36 ----------------------------------------------------------------------*/
37 #define MAX_NUM_CHUNKS 64 /* Limit on pieces */
38 
39 typedef struct
40 {
43 } STATE;
44 
46 typedef int *SEARCH_STATE;
47 
50 
51 /*----------------------------------------------------------------------
52  F u n c t i o n s
53 ----------------------------------------------------------------------*/
54 SEARCH_STATE bin_to_chunks(STATE *state, int num_joints);
55 
56 void bin_to_pieces(STATE *state, int num_joints, PIECES_STATE pieces);
57 
58 void insert_new_chunk(register STATE *state,
59  register int index,
60  int num_joints);
61 
62 STATE *new_state(STATE *oldstate);
63 
64 int ones_in_state(STATE *state, int num_joints);
65 
66 void print_state(const char *label, STATE *state, int num_joints);
67 
68 void print_state(STATE *state, int num_joints, STRING *toappend);
69 
70 void set_n_ones(STATE *state, int n);
71 
72 extern void free_state(STATE *);
73 
74 #endif