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
00012
00013
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
00028
00029
00030
00031
00032
00033 typedef struct chain_node {
00034 unsigned char code;
00035
00036 unsigned char valid;
00037 struct chain_node *next;
00038 } CHAIN_NODE;
00039
00040
00041 typedef struct list_node {
00042 unsigned int startj;
00043 unsigned int startk;
00044 unsigned char ring_type;
00045 int ring_id;
00046 CHAIN_NODE *chain;
00047 struct list_node *next;
00048 } LIST_NODE;
00049
00050
00051 typedef struct {
00052 unsigned int nlin;
00053 unsigned int npix;
00054 char header[504];
00055 LIST_NODE *list;
00056 } CHAIN;
00057
00058
00059
00060
00061
00062
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