home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume19 / fbm / part01 / fbm2tga.c < prev    next >
C/C++ Source or Header  |  1989-06-08  |  1KB  |  50 lines

  1. /*****************************************************************
  2.  * fbm2tga.c: FBM Library 0.93 (Beta test) 03-May-89  Michael Mauldin
  3.  *
  4.  * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  5.  * use this file in whole or in part provided that you do not sell it
  6.  * for profit and that this copyright notice is retained unchanged.
  7.  *
  8.  * fbm2tga.c: convert a bitmap to Targa format
  9.  *
  10.  * USAGE
  11.  *    % fbm2tga [ image ] > image.tga
  12.  *
  13.  * EDITLOG
  14.  *    LastEditDate = Wed May  3 21:50:43 1989 - Michael Mauldin
  15.  *    LastFileName = /usr2/mlm/src/misc/fbm/fbm2tga.c
  16.  *
  17.  * HISTORY
  18.  * 03-May-89  Michael Mauldin (mlm) at Carnegie Mellon University
  19.  *    Beta release (version 0.93) mlm@cs.cmu.edu
  20.  *****************************************************************/
  21.  
  22. # include <stdio.h>
  23. # include <math.h>
  24. # include "fbm.h"
  25.  
  26. # define USAGE\
  27. "Usage: fbm2tga [ image ] > image.tga"
  28.  
  29. #ifndef lint
  30. static char *fbmid =
  31.     "$FBM fbm2tga.c <0.93> 03-May-89  (C) 1989 by Michael Mauldin$";
  32. #endif
  33.  
  34. main (argc,argv)
  35. int argc; char *argv[];
  36. { FBM image;
  37.  
  38.   /* Clear pointers */
  39.   image.cm = image.bm = (unsigned char *) NULL;
  40.  
  41.   /* Read anything, write targa */
  42.   if (read_bitmap (&image, (argc > 0) ? *argv : (char *) NULL) &&
  43.       write_tga (&image, stdout))
  44.   {
  45.     exit (0);
  46.   }
  47.   else
  48.   { exit (1); }
  49. }
  50.