NAME

     write_Image - writes the contents of a CVIP Image  structure
     out to disk

SYNOPSIS

      #include <CVIPtoolkit.h>
      #include <CVIPimage.h>
      #include <CVIPlconvert.h>

     write_Image(Image *cvip_Image, char *filename,  CVIP_BOOLEAN
     retain_image,  CVIP_BOOLEAN set_up, IMAGE_FORMAT new_format,
     CVIP_BOOLEAN showmessages)

      <cvip_Image> - pointer to valid CVIP Image structure
      <filename> - pointer to an character string containing  the
     file name
      <retain_image> - retain image after  writing  (CVIP_YES  or
     CVIP_NO)?
      <set_up> - run setup (CVIP_YES or CVIP_NO)?
      <new_format> - enumeration constant specifying  the  format
     of the file to be read in
      <showmessages> - shall I be verbose (CVIP_YES or CVIP_NO)?

PATH

     $CVIPHOME/CONVERSION/convert.c

DESCRIPTION

      Writes the contents of a CVIP Image structure out  to  disk
     in  the  specified  format <new_format>. Many of the formats
     offer variations on the way a file can be presented to disk.
     (e.g.  compression  schemes,  byte  ordering, etc..) To take
     full advantage of this a set-up routine can be run  by  set-
     ting  <set-up> equal to CVIP_YES; otherwise, default options
     will be used. Set-up routines vary for each format.

TYPES AND CONSTANTS


RETURN VALUES

     Pointer to newly allocated Image structure

HISTORY

     History information recorded: None

EXAMPLE

      #include <CVIPtoolkit.h>
      #include <CVIPimage.h>
      #include <CVIPdef.h>
      #include <CVIPview.h>
      #include <CVIPconvert.h>
      #define VIEWER "picture"
      #define VIDEO_APP "SunVideo &"

      void main()
      {
      Image *cvipImage;
      IMAGE_FORMAT format;
      char *inputfile,*outputfile;

      setDisplay_Image(VIEWER, "Default");
      print_CVIP("\n\t\tEnter the  Input File Name:  ");
      inputfile =(char *) getString_CVIP();
      format = getFormat_CVIP(inputfile);
      /* the following call loads an image structure with data
      from the specified file */
      cvipImage = read_Image(inputfile,1);
      view_Image(cvipImage, inputfile);
      free(inputfile);
      print_CVIP("\n\t\tEnter the Output File Name:  ");
      outputfile = getString_CVIP();
      view_Image(cvipImage,outputfile);
      /* the following call writes the contents of the CVIP image
      structure out to disk.The format is the same as the
      input file format */
      write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1);
      free(outputfile);
      }

SEE ALSO

     libconverter(3)

AUTHOR

     Copyright (C) 1996 SIUE -  by  Scott  E.  Umbaugh  and  Greg
     Hance.