#ifndef pz_i2_chain_H #define pz_i2_chain_H /* Sequences (possibly periodic) of points of the integer grid. */ /* Last edited on 2015-01-20 16:49:15 by stolfilocal */ #include #include typedef i2_vec_t pz_i2_chain_t; /* The "DoXXX" procedures below are analogous to the "XXX" procedures, except that the result is returned in an array provided by the client (which must have the correct size). */ pz_i2_chain_t pz_i2_chain_cut(pz_i2_chain_t *c, int start, int length); void pz_i2_chain_do_cut(pz_i2_chain_t *c, int start, int length, pz_i2_chain_t *x); /* Returns a new chain that is a copy of elements from "c[start]" to "c[start+length-1]". Assumes the chain is periodic, i.e. "c[i+n]==c[i]" for all "i", where "n==(c.ne)". */ void pz_i2_chain_reverse (pz_i2_chain_t *c); /* pz_i2_chain_reverses the chain "c" back-to-front. */ pz_i2_chain_t pz_i2_chain_extract_segment (pz_i2_chain_t *c, pz_segment_t *s); void pz_i2_chain_do_extract_segment (pz_i2_chain_t *c, pz_segment_t *s, pz_i2_chain_t *x); /* Extracts the given segment from the curvature graph "c", assumed to be closed. If "s.rev" is TRUE, also reverses it. */ typedef struct pz_i2_chain_read_data { char *cmt; pz_i2_chain_t c; } pz_i2_chain_read_data; void pz_i2_chain_write (FILE *wr, char *cmt, pz_i2_chain_t *c); pz_i2_chain_read_data pz_i2_chain_read (FILE *rd); /* Copyright © 2001 Universidade Estadual de Campinas (UNICAMP). Authors: Helena C. G. Leitão and Jorge Stolfi. This file can be freely distributed, used, and modified, provided that this copyright and authorship notice is preserved, and that any modified versions are clearly marked as such. This software has NO WARRANTY of correctness or applicability for any purpose. Neither the authors nor their employers chall be held responsible for any losses or damages that may result from its use. */ #endif