1:  #ifndef CHAINCODE_H
2:  #define CHAINCODE_H
3:  
4:  #include "linked_list.h"
5:  #include "research.h"
6:  #include "bool.h"
7:  #include "pgm.h"
8:  
9:  
10:  /*These constant values are the chain code directions*/
11:  #define NONE      -1
12:  #define EAST      0
13:  #define NORTHEAST 1
14:  #define NORTH     2
15:  #define NORTHWEST 3
16:  #define WEST      4  
17:  #define SOUTHWEST 5
18:  #define SOUTH     6
19:  #define SOUTHEAST 7
20:  
21:  /*old typedefs*/
22:  /*typedef struct chainCode* chain_t;
23:  typedef struct chainCode
24:  {
25:    chain_t prev;
26:    int code;    
27:    coord location;*/ /*absolute pixel location for starting point*/
28:  /*  chain_t next;
29:      }chainCode;*/ /*This struct can be refered to by: struct chainCode or chainCode*/
30:  
31:  
32:  
33:  
34:  /***********prototypes************************************************/
35:  
36:  int checkCode(list_info* list_pointers, int x_current, int y_current,
37:  	      int x_check, int y_check, int dir);
38:  
39:  int checkThings(int x_check, int y_check, PGMImage *img);
40:  
41:  chain neighborhood_point(int x_coord, int y_coord, int dir);
42:  
43:  int chaincode(PGMImage *img, int x, int y, int dir, list_info *list_pointers);
44:  
45:  int alreadyFound(int initThreashFlag, int i, int j, list_info* found);
46:  
47:  void saveChainCode(list_info saveChain, int count);
48:  
49:  void free_chaincodes(list_info** aogccp);
50:  
51:  list_info* showChain(PGMImage *original, list_info **the_lists);
52:  
53:  #endif