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