Tesseract 3.01
|
00001 /* -*-C-*- 00002 ******************************************************************************** 00003 * 00004 * File: states.h (Formerly states.h) 00005 * Description: Representations of search states 00006 * Author: Mark Seaman, OCR Technology 00007 * Created: Wed May 16 15:52:40 1990 00008 * Modified: Tue May 21 16:26:21 1991 (Mark Seaman) marks@hpgrlt 00009 * Language: C 00010 * Package: N/A 00011 * Status: Experimental (Do Not Distribute) 00012 * 00013 * (c) Copyright 1990, Hewlett-Packard Company. 00014 ** Licensed under the Apache License, Version 2.0 (the "License"); 00015 ** you may not use this file except in compliance with the License. 00016 ** You may obtain a copy of the License at 00017 ** http://www.apache.org/licenses/LICENSE-2.0 00018 ** Unless required by applicable law or agreed to in writing, software 00019 ** distributed under the License is distributed on an "AS IS" BASIS, 00020 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00021 ** See the License for the specific language governing permissions and 00022 ** limitations under the License. 00023 * 00024 *********************************************************************************/ 00025 #ifndef STATES_H 00026 #define STATES_H 00027 00028 /*---------------------------------------------------------------------- 00029 I n c l u d e s 00030 ----------------------------------------------------------------------*/ 00031 #include "host.h" 00032 00033 /*---------------------------------------------------------------------- 00034 T y p e s 00035 ----------------------------------------------------------------------*/ 00036 #define MAX_NUM_CHUNKS 64 /* Limit on pieces */ 00037 00038 typedef struct 00039 { 00040 uinT32 part1; 00041 uinT32 part2; 00042 } STATE; 00043 00045 typedef int *SEARCH_STATE; 00046 00048 typedef uinT8 PIECES_STATE[MAX_NUM_CHUNKS + 2]; 00049 00050 /*---------------------------------------------------------------------- 00051 F u n c t i o n s 00052 ----------------------------------------------------------------------*/ 00053 SEARCH_STATE bin_to_chunks(STATE *state, int num_joints); 00054 00055 void bin_to_pieces(STATE *state, int num_joints, PIECES_STATE pieces); 00056 00057 void insert_new_chunk(register STATE *state, 00058 register int index, 00059 int num_joints); 00060 00061 STATE *new_state(STATE *oldstate); 00062 00063 int ones_in_state(STATE *state, int num_joints); 00064 00065 void print_state(const char *label, STATE *state, int num_joints); 00066 00067 void set_n_ones(STATE *state, int n); 00068 00069 extern void free_state(STATE *); 00070 00071 #endif