include include include "ecidentify.h" # EC_NEWFEATURE -- Allocate and initialize memory for a new feature. procedure ec_newfeature (ec, ap, pix, fit, user, width, type) pointer ec # ID pointer int ap # Order double pix # Pixel coordinate double fit # Fit coordinate double user # User coordinate real width # Feature width int type # Feature type int i, j, ec_line() double delta define NALLOC 20 # Length of additional allocations begin if (IS_INDEFD (pix)) return delta = MAX_REAL do i = 1, EC_NFEATURES(ec) { if (APN(ec,i) != ap) next if (abs (pix - PIX(ec,i)) < delta) { delta = abs (pix - PIX(ec,i)) j = i } } if (delta >= EC_MINSEP(ec)) { EC_NFEATURES(ec) = EC_NFEATURES(ec) + 1 if (EC_NALLOC(ec) < EC_NFEATURES(ec)) { EC_NALLOC(ec) = EC_NALLOC(ec) + NALLOC call realloc (EC_APNUM(ec), EC_NALLOC(ec), TY_INT) call realloc (EC_LINENUM(ec), EC_NALLOC(ec), TY_INT) call realloc (EC_ORD(ec), EC_NALLOC(ec), TY_INT) call realloc (EC_PIX(ec), EC_NALLOC(ec), TY_DOUBLE) call realloc (EC_FIT(ec), EC_NALLOC(ec), TY_DOUBLE) call realloc (EC_USER(ec), EC_NALLOC(ec), TY_DOUBLE) call realloc (EC_FWIDTHS(ec), EC_NALLOC(ec), TY_REAL) call realloc (EC_FTYPES(ec), EC_NALLOC(ec), TY_INT) } for (j=EC_NFEATURES(ec); (j>1)&&(ap1)&&(ap==APN(ec,j-1))&&(pix