/* $Id$ */

#ifndef __GSCLOSE_H__
#define __GSCLOSE_H__

#include "IPAsupp.h"
#include <stdio.h>

/* Constants */

/* Worm algorithm flags */
#define TRACK_USE_MAXIMUM           0x0001 /* ä×ÉÇÁÔØÓÑ ÐÏ ÍÁËÓÉÍÁÌØÎÙÍ ÚÎÁÞÅÎÉÑÍ */
#define TRACK_USE_MINIMUM           0x0000 /* ä×ÉÇÁÔØÓÑ ÐÏ ÍÉÎÉÍÁÌØÎÙÍ ÚÎÁÞÅÎÉÑÍ */
#define TRACK_REACH_END_POINT       0x0002 /* ä×ÉÇÁÔØÓÑ ÄÏ ÄÏÓÔÉÖÅÎÉÑ ÚÁÄÁÎÎÏÊ */
                                           /* ËÏÎÅÞÎÏÊ ÔÏÞËÉ */
#define TRACK_CLOSE_CONTOUR         0x0000 /* ä×ÉÇÁÔØÓÑ, ÐÏËÁ ÎÅ ÚÁÍËÎÅÔÓÑ ËÏÎÔÕÒ */
#define TRACK_CLOSE_ON_FIRST        0x0004 /* úÁËÒÙ×ÁÔØ ÔÏÌØËÏ ÐÏ ÄÏÓÔÉÖÅÎÉÀ ÓÔÁÒÔÏ×ÏÊ */
                                           /* ÔÏÞËÉ */
#define TRACK_CLOSE_ON_ANY          0x0000 /* úÁËÒÙ×ÁÔØ ÐÏ ÄÏÓÔÉÖÅÎÉÀ ÌÀÂÏÊ ÔÏÞËÉ ËÏÎÔÕÒÁ */
#define TRACK_SLOPPY_DIRECTIONS     0x0008 /* éÓÐÏÌØÚÕÀÔÓÑ ÐÑÔØ ÎÁÐÒÁ×ÌÅÎÉÊ ÉÚ 9 */
#define TRACK_STRICT_DIRECTIONS     0x0000 /* éÓÐÏÌØÚÕÀÔÓÑ ÔÒÉ ÎÁÐÒÁ×ÌÅÎÉÑ ÉÚ 9 */
#define TRACK_NO_CIRCLES            0x0010 /* "ïÔÒÅÚÁÔØ" ËÏÌØÃÁ */

extern PImage gs_close_edges(
                      PImage edges,
                      PImage gradient,
                      int maxlen,      /* ÍÁËÓÉÍÁÌØÎÏ ÄÏÐÕÓÔÉÍÁÑ ÄÌÉÎÁ ×ÎÏ×Ø ÓÏÚÄÁÎÎÏÇÏ ÕÞÁÓÔËÁ ÇpÁÎÉÃÙ */
                      int minedgelen,  /* ÍÉÎÉÍÁÌØÎÁÑ ÄÌÉÎÁ "ÄÌÉÎÎÏÊ" ÇÒÁÎÉÃÙ */
                      int mingradient  /* ÍÉÎÉÍÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÇpÁÄÉÅÎÔÁ, ËÏÔÏpÏÅ ÂÕÄÅÔ ÕÞÉÔÙ×ÁÔØÓÑ */
                     );
extern PImage gs_track(
                       PImage img,
                       int startpos,
                       int endpos,
                       int treshold,
                       unsigned long flags
                      );

#endif /* __GSCLOSE_H__ */