Main Page | Class List | File List | Class Members | File Members

chain.h

00001 #ifndef CHAIN_H
00002 #define CHAIN_H 1
00003 #include  "sadie_byte.h"
00004 #include  "mosaic.h"
00005 #include  "trees_profile.h"
00006 #include "project_utilities.h"
00007 
00008 BEGIN_C_DECLARATIONS
00009 
00010 /*----------------------------------------------------------------------------*/
00011 /*-General Information--------------------------------------------------------*/
00012 /*                                                                            */
00013 /*   Macro definitions for chain codes.                                       */
00014 /*                                                                            */
00015 /*                                                                            */
00016 /*----------------------------------------------------------------------------*/
00017 #define  NORMAL   0
00018 #define  ADDED    1
00019 #define  REMOVED  2
00020 
00021 #define  TERM_CODE           9
00022 #define  TERM_VALID          0
00023 #define  CHAIN_HEADER_SIZE   512
00024 
00025 
00026 /*----------------------------------------------------------------------------*/
00027 /*-General Information--------------------------------------------------------*/
00028 /*                                                                            */
00029 /*   Data structures to store chain codes.                                    */
00030 /*                                                                            */
00031 /*                                                                            */
00032 /*----------------------------------------------------------------------------*/
00033 typedef struct chain_node {
00034     unsigned char  code;            /* Code indicating orientation of current
00035                                        pixel wrt previous pixel in the chain. */
00036     unsigned char  valid;           /* Tag indicating pixel validity.         */
00037     struct chain_node *next;        /* Pointer to next pixel node.            */
00038 }                       CHAIN_NODE;
00039 
00040 
00041 typedef struct list_node {
00042     unsigned int  startj;           /* Line coordinate of first ring pixel.   */
00043     unsigned int  startk;           /* Pixel coordinate of first ring pixel.  */
00044     unsigned char ring_type;        /* Number representing boundary type.     */
00045     int           ring_id;          /* Boundary ID.                           */
00046     CHAIN_NODE         *chain;      /* Pointer to chain code of the ring.     */
00047     struct list_node   *next;       /* Pointer to chain code of next ring.    */
00048 }                       LIST_NODE;      
00049 
00050 
00051 typedef struct {
00052     unsigned int  nlin;             /* Number of lines in image.              */
00053     unsigned int  npix;             /* Number of pixels/line.                 */
00054     char          header[504];      /* Header space for future expansion.     */
00055     LIST_NODE     *list;            /* Pointer to the list of chains.         */
00056 }                       CHAIN;
00057 
00058 
00059 /*----------------------------------------------------------------------------*/
00060 /*-General Information--------------------------------------------------------*/
00061 /*                                                                            */
00062 /*   Function declarations.                                                   */
00063 /*                                                                            */
00064 /*                                                                            */
00065 /*----------------------------------------------------------------------------*/
00066 void RELMEM_CHAIN (CHAIN *);
00067 void demolish_chainlist (LIST_NODE ** thelisthandle);
00068 void demolish_chainmap (CHAIN ** thechainmaphandle);
00069 LIST_NODE * copy_chainlist (LIST_NODE * oldlist);
00070 void copy_chainlist_head (LIST_NODE * oldhead, LIST_NODE ** newhandle);
00071 void search_chainlist_by_id (int id, LIST_NODE * thelist,
00072                              LIST_NODE ** pred_handle,
00073                              LIST_NODE ** match_handle, int * indexpos);
00074 void CHAIN2DISK (CHAIN *,char *);
00075 void SCALE_CHAIN (CHAIN *, int, CHAIN **);
00076 void DISK2CHAIN (char *, CHAIN **);
00077 void CHAIN_COMPUTE_COORDINATES (int, int, unsigned char, int *, int *);
00078 void CHAIN_COMPUTE_CODE (int , int , int , int , unsigned char *);
00079 void CHAIN_RINGWIDTHS (IMAGE_BYTE  *, MOSAIC_INDEX *, CHAIN  *, PROFILE_LIST *, int *, double **, BOUNDBOX_LIST *);
00080 
00081 END_C_DECLARATIONS
00082 
00083 #endif /* !CHAIN_H */

Generated on Sat Dec 4 17:12:09 2004 for trees by  doxygen 1.3.9.1