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 / vgmclose / vgmclose.h < prev    next >
C/C++ Source or Header  |  1992-07-26  |  4KB  |  117 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: vgmclose.h
  42.  >>>>            Author: Pascal ADAM and Greg DONOHOE
  43.  >>>> Date Last Updated: Thu Jul 23 16:18:13 1992
  44.  >>>> 
  45.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
  46.  
  47. #ifndef _vgmclose_h_
  48. #define _vgmclose_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. *                    vgmclose Argument Structure
  63. *
  64. ****************************************************************/
  65.  
  66. typedef struct _vgmclose  {
  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. }  vgmclose_struct;
  87.  
  88. vgmclose_struct *vgmclose;
  89.  
  90. /* -include_additions */
  91. /* -include_additions_end */
  92.  
  93. /* -include_macros */
  94. #define READINPUT(image,kernel) \
  95. image = readimage(vgmclose->i_file);  \
  96. if (image == NULL) {  \
  97.    (void) fprintf(stderr, "vgmclose: Can not read input image \n");  \
  98.    exit(1);  /* Quit if bad image */ \
  99. } \
  100. kernel = readimage(vgmclose->k_file);  \
  101. if (kernel == NULL) {  \
  102.    (void) fprintf(stderr, "vgmclose: Can not read input kernel\n");  \
  103.    exit(1);  /* Quit if bad kernel */ \
  104. }
  105. #define CHECKINPUT(program, image,kernel) \
  106.     propertype(program,image,VFF_TYP_1_BYTE,TRUE); \
  107.     proper_num_images(program,image,1,TRUE);  \
  108.     proper_num_bands(program,image,1,TRUE);  \
  109.     proper_map_enable(program,image,VFF_MAP_OPTIONAL,TRUE); \
  110.     propertype(program,kernel,VFF_TYP_4_BYTE,TRUE) ; \
  111.     proper_num_images(program,kernel,1,TRUE);  \
  112.     proper_num_bands(program,kernel,1,TRUE);  \
  113.     proper_map_enable(program,kernel,VFF_MAP_OPTIONAL,TRUE); \
  114. /* -include_macros_end */
  115.  
  116. #endif
  117.