 /*
  * Khoros: $Id: vslope.h,v 1.1 1991/05/10 15:51:51 khoros Exp $
  */

 /*
  * $Log: vslope.h,v $
 * Revision 1.1  1991/05/10  15:51:51  khoros
 * Initial revision
 *
  */ 

/*
 *----------------------------------------------------------------------
 *
 * Copyright 1991, University of New Mexico.  All rights reserved.
 * Permission to copy and modify this software and its documen-
 * tation only for internal use in your organization is hereby
 * granted, provided that this notice is retained thereon and
 * on all copies.  UNM makes no representations as too the sui-
 * tability and operability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 * 
 * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
 * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT-
 * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER-
 * FORMANCE OF THIS SOFTWARE.
 * 
 * No other rights, including for example, the right to redis-
 * tribute this software and its documentation or the right to
 * prepare derivative works, are granted unless specifically
 * provided in a separate license agreement.
 *---------------------------------------------------------------------
 */

#include "unmcopyright.h"        /* Copyright 1991 by UNM */


/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 >>>>
 >>>>         File Name: vslope.h
 >>>>            Author: Per Lysne
 >>>> Date Last Updated: Thu Mar  7 15:34:10 1991
 >>>> 
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

#ifndef _vslope_h_
#define _vslope_h_

#include "vinclude.h"


/* -include_includes */
/* -include_includes_end */

char	**av,		/* argv and argc used by gparams */
	*program,	/* a pointer to the program name argv[0] */
	*calloc();
int	ac;

/****************************************************************
*
*                    vslope Argument Structure
*
****************************************************************/

typedef struct _vslope  {

/*
 *  input image (Required infile)
 */
char	*i_file;	/* input image FILENAME */
int	 i_flag;	/* input image FLAG */

/*
 *  slope image (Optional outfile)
 */
char	*s_file;	/* slope image FILENAME */
int	 s_flag;	/* slope image FLAG */

/*
 *  aspect image (Optional outfile)
 */
char	*t_file;	/* aspect image FILENAME */
int	 t_flag;	/* aspect image FLAG */

/*
 *  Value for Regions With no Aspect (flat) (Optional float)
 */
float	 z_float;	/* Value for Regions With no Aspect (flat) FLOAT */
int	 z_flag;   	/* Value for Regions With no Aspect (flat) FLAG */

/*
 * slope options (Optional integer toggle - )
 */
int	 so_toggle;		/* slope options INT TOGGLE */
int	 so_flag;		/* slope options FLAG */

/*
 * aspect options (Optional integer toggle - )
 */
int	 to_toggle;		/* aspect options INT TOGGLE */
int	 to_flag;		/* aspect options FLAG */

}  vslope_struct;

vslope_struct *vslope;

/* -include_additions */
/* -include_additions_end */

/* -include_macros */
#define CHECKINPUT(program, img) {                                            \
        (void) proper_map_enable (program, img, VFF_MAP_OPTIONAL, TRUE);      \
        (void) proper_num_images (program, img, 1, TRUE);                     \
        (void) proper_loc_type   (program, img, VFF_LOC_IMPLICIT, TRUE);      \
        if ((img->data_storage_type != VFF_TYP_1_BYTE) &&                     \
            (img->data_storage_type != VFF_TYP_2_BYTE) &&                     \
            (img->data_storage_type != VFF_TYP_4_BYTE) &&                     \
            (img->data_storage_type != VFF_TYP_FLOAT)) {                      \
            fprintf (stderr, "error in vslope: input data type must be ");    \
            fprintf (stderr, "byte, short, int, or float\n");                 \
            exit (1);                                                         \
        }                                                                     \
        if (img->pixsizx <= 0) {                                              \
            fprintf (stderr,                                                  \
                "error in vslope: x pixel size must be greater than 0\n");    \
            exit (1);                                                         \
        }                                                                     \
        if (img->pixsizy <= 0) {                                              \
            fprintf (stderr,                                                  \
                "error in vslope: y pixel size must be greater than 0\n");    \
            exit (1);                                                         \
        }                                                                     \
        if (img->pixsizx != img->pixsizy) {                                   \
            fprintf (stderr,                                                  \
                "error in vslope: x and y pixel sizes must be the same\n");   \
            exit (1);                                                         \
        }                                                                     \
}
/* -include_macros_end */

#endif
