home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / morpho.zip / morpho / src / vgmtophat / vgmtophat.h < prev    next >
C/C++ Source or Header  |  1992-07-28  |  4KB  |  129 lines

  1.  /*
  2.   * Khoros: $Id$
  3.   */
  4.  
  5.  /*
  6.   * $Log$
  7.   */
  8.  
  9. /*
  10.  *----------------------------------------------------------------------
  11.  *
  12.  * Copyright 1992, University of New Mexico.  All rights reserved.
  13.  * Permission to copy and modify this software and its documen-
  14.  * tation only for internal use in your organization is hereby
  15.  * granted, provided that this notice is retained thereon and
  16.  * on all copies.  UNM makes no representations as to the sui-
  17.  * tability and operability of this software for any purpose.
  18.  * It is provided "as is" without express or implied warranty.
  19.  * 
  20.  * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  21.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
  22.  * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL,
  23.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT-
  24.  * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  25.  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  26.  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER-
  27.  * FORMANCE OF THIS SOFTWARE.
  28.  * 
  29.  * No other rights, including, for example, the right to redis-
  30.  * tribute this software and its documentation or the right to
  31.  * prepare derivative works, are granted unless specifically
  32.  * provided in a separate license agreement.
  33.  *---------------------------------------------------------------------
  34.  */
  35.  
  36. #include "unmcopyright.h"        /* Copyright 1992 by UNM */
  37.  
  38.  
  39. /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  40.  >>>>
  41.  >>>>         File Name: vgmtophat.h
  42.  >>>>            Author: Greg DONOHOE and Pascal ADAM
  43.  >>>> Date Last Updated: Mon Jul 27 16:51:57 1992
  44.  >>>> 
  45.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
  46.  
  47. #ifndef _vgmtophat_h_
  48. #define _vgmtophat_h_
  49.  
  50. #include "vinclude.h"
  51.  
  52.  
  53. /* -include_includes */
  54. /* -include_includes_end */
  55.  
  56. char    **av,        /* argv and argc used by gparams */
  57.     *program;    /* a pointer to the program name argv[0] */
  58. int    ac;
  59.  
  60. /****************************************************************
  61. *
  62. *                    vgmtophat Argument Structure
  63. *
  64. ****************************************************************/
  65.  
  66. typedef struct _vgmtophat  {
  67.  
  68. /*
  69.  *  input image (Required infile)
  70.  */
  71. char    *i_file;    /* input image FILENAME */
  72. int     i_flag;    /* input image FLAG */
  73.  
  74. /*
  75.  *  input kernel (Required infile)
  76.  */
  77. char    *k_file;    /* input kernel FILENAME */
  78. int     k_flag;    /* input kernel FLAG */
  79.  
  80. /*
  81.  *  output image (Required outfile)
  82.  */
  83. char    *o_file;    /* output image FILENAME */
  84. int     o_flag;    /* output image FLAG */
  85.  
  86. /*
  87.  *  proportion to subtract (Required float)
  88.  */
  89. float     s_float;    /* proportion to subtract FLOAT */
  90. int     s_flag;       /* proportion to subtract FLAG */
  91.  
  92. /*
  93.  *  normalize  output (Required logical)
  94.  */
  95. int     normal_logic;    /* normalize  output LOGIC */
  96. int     normal_flag;      /* normalize  output FLAG */
  97.  
  98. }  vgmtophat_struct;
  99.  
  100. vgmtophat_struct *vgmtophat;
  101.  
  102. /* -include_additions */
  103. /* -include_additions_end */
  104.  
  105. /* -include_macros */
  106. #define READINPUT(image1,kernel) \
  107. image1 = readimage(vgmtophat->i_file);  \
  108. if (image1 == NULL) {  \
  109.    (void) fprintf(stderr, "vgmtophat: Can not read input image \n");  \
  110.    exit(1);  /* Quit if bad image */ \
  111. } \
  112. kernel = readimage(vgmtophat->k_file);  \
  113. if (kernel == NULL) {  \
  114.    (void) fprintf(stderr, "vgmtophat: Can not read input kernel\n");  \
  115.    exit(1);  /* Quit if bad kernel */ \
  116. }
  117. #define CHECKINPUT(program, image1, kernel) \
  118.     propertype(program,image1,VFF_TYP_1_BYTE,TRUE); \
  119.     proper_num_images(program,image1,1,TRUE);  \
  120.     proper_num_bands(program,image1,1,TRUE);  \
  121.     proper_map_enable(program,image1,VFF_MAP_OPTIONAL,TRUE); \
  122.     propertype(program,kernel,VFF_TYP_4_BYTE,TRUE) ; \
  123.     proper_num_images(program,kernel,1,TRUE);  \
  124.     proper_num_bands(program,kernel,1,TRUE);  \
  125.     proper_map_enable(program,kernel,VFF_MAP_OPTIONAL,TRUE); \
  126. /* -include_macros_end */
  127.  
  128. #endif
  129.