dict/states.h

Go to the documentation of this file.
00001 
00020 #ifndef STATES_H
00021 #define STATES_H
00022 
00023 /*----------------------------------------------------------------------
00024               I n c l u d e s
00025 ----------------------------------------------------------------------*/
00026 #include "general.h"
00027 
00028 /*----------------------------------------------------------------------
00029               T y p e s
00030 ----------------------------------------------------------------------*/
00032 #define MAX_NUM_CHUNKS  64
00033 
00047 typedef struct
00048 {
00049   UINT32 part1;
00050   UINT32 part2;
00051 } STATE;
00052 
00057 typedef int *SEARCH_STATE;
00058 
00064 typedef UINT8 PIECES_STATE[MAX_NUM_CHUNKS + 2];
00065 
00066 /*----------------------------------------------------------------------
00067               F u n c t i o n s
00068 ----------------------------------------------------------------------*/
00069 SEARCH_STATE bin_to_chunks(STATE *state, int num_joints); 
00070 
00071 void bin_to_pieces(STATE *state, int num_joints, PIECES_STATE pieces); 
00072 
00073 void insert_new_chunk(register STATE *state,
00074                       register int index,
00075                       int num_joints);
00076 
00077 STATE *new_state(STATE *oldstate); 
00078 
00079 int ones_in_state(STATE *state, int num_joints); 
00080 
00081 void print_state(const char *label, STATE *state, int num_joints); 
00082 
00083 void set_n_ones(STATE *state, int n); 
00084 
00085 int compare_states(STATE *true_state, STATE *this_state, int *blob_index); 
00086 
00087 extern void free_state(STATE *); 
00088 
00089 /*
00090 #if defined(__STDC__) || defined(__cplusplus)
00091 # define _ARGS(s) s
00092 #else
00093 # define _ARGS(s) ()
00094 #endif*/
00095 
00096 /* states.c
00097 void insert_new_chunk
00098   _ARGS((STATE *state,
00099   int index));
00100 
00101 SEARCH_STATE bin_to_chunks
00102   _ARGS((STATE *state,
00103   int num_joints));
00104 
00105 STATE *new_state
00106   _ARGS((STATE *oldstate));
00107 
00108 int ones_in_state
00109   _ARGS((STATE *state,
00110   int num_joints));
00111 
00112 void print_state
00113   _ARGS((char *label,
00114   STATE *state,
00115   int num_joints));
00116 
00117 void set_n_ones
00118   _ARGS((STATE *state,
00119   int n));
00120 int compare_states
00121   _ARGS((
00122 STATE *true_state,
00123 STATE *this_state,
00124 int*   blob_index));
00125 
00126 #undef _ARGS
00127 */
00128 #endif

Generated on Wed Feb 28 19:49:10 2007 for Tesseract by  doxygen 1.5.1