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