include include "identify.h" # ID_NEWFEATURE -- Allocate and initialize memory for a new feature. procedure id_newfeature (id, pix, fit, user, wt, width, type, label) pointer id # ID pointer double pix # Pixel coordinate double fit # Fit coordinate double user # User coordinate double wt # Feature weight real width # Feature width int type # Feature type pointer label # Pointer to feature label int i, current, strlen() double delta define NALLOC 20 # Length of additional allocations begin if (IS_INDEFD (pix)) return delta = MAX_REAL do i = 1, ID_NFEATURES(id) { if (abs (pix - PIX(id,i)) < delta) { delta = abs (pix - PIX(id,i)) current = i } } if (delta >= ID_MINSEP(id)) { ID_NFEATURES(id) = ID_NFEATURES(id) + 1 if (ID_NALLOC(id) < ID_NFEATURES(id)) { ID_NALLOC(id) = ID_NALLOC(id) + NALLOC call realloc (ID_PIX(id), ID_NALLOC(id), TY_DOUBLE) call realloc (ID_FIT(id), ID_NALLOC(id), TY_DOUBLE) call realloc (ID_USER(id), ID_NALLOC(id), TY_DOUBLE) call realloc (ID_WTS(id), ID_NALLOC(id), TY_DOUBLE) call realloc (ID_FWIDTHS(id), ID_NALLOC(id), TY_REAL) call realloc (ID_FTYPES(id), ID_NALLOC(id), TY_INT) call realloc (ID_LABEL(id), ID_NALLOC(id), TY_POINTER) call aclri (Memi[ID_LABEL(id)+ID_NALLOC(id)-NALLOC], NALLOC) } for (current=ID_NFEATURES(id); (current>1)&&(pix