/***************************************************************
 * file: ZONE.H
 * purpose: definitions, types and prototypes for zone.c
 **************************************************************/

/* definitions */
    /* sampling */
#define SAMPLE_200_X 8      /* x sample frequency for a 
                               200 dpi image */
#define SAMPLE_200_Y 10     /* y sample frequency for a 
                               200 dpi image */
#define MAX_MALLOC 0xff00   /* maximum malloc size */

    /* vertical line cutting */
#define CUT_VERTICAL_LINES 0    /* turn vertical line cutting on/off */
#define VERTICAL_LINE_SIZE 16   /* minimum vertical line length @ 200 dpi */

    /* blocking */
#define WHITE 0x00          /* white color in sample */
#define BLACK 0xff          /* black color in sample */
#define PREGNANT 0x01       /* ready to be black */
#define SICK 0xfe           /* ready to be white */
#define ALIVE 0x80          /* still alive */
#define LIFE_SCORE 2        /* neighbors for birth */
#define DEATH_SCORE 0       /* neighbors for death */

    /* sequencing */
typedef struct { int x1,y1,x2,y2; } ZONE;
#define MIN_X_ZONE 4        /* minimum allowable x 
                               extent for a zone */
#define MIN_Y_ZONE 2        /* minimum allowable y 
                               extent for a zone */
typedef enum { GOING_UP,GOING_RIGHT,GOING_DOWN,GOING_LEFT } HEADING;
#define MAX_ZONES 99        /* maximum number of 
                               zones */
#define COLUMN_MAJOR 1      /* order zones with columns 
                               dominate */
#define ROW_MAJOR 2         /* order zones with rows 
                               dominate */

    /* prototypes */
int zone(int coarseness,int order);
