home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / fbm / src / fbm2tga.c < prev    next >
C/C++ Source or Header  |  1990-06-24  |  2KB  |  57 lines

  1. /*****************************************************************
  2.  * fbm2tga.c: FBM Release 1.0 25-Jun-90 Michael Mauldin
  3.  *
  4.  * Copyright (C) 1989,1990 by Michael Mauldin.  Permission is granted
  5.  * to use this file in whole or in part for any purpose, educational,
  6.  * recreational or commercial, provided that this copyright notice
  7.  * is retained unchanged.  This software is available to all free of
  8.  * charge by anonymous FTP and in the UUNET archives.
  9.  *
  10.  * fbm2tga.c: convert a bitmap to Targa format
  11.  *
  12.  * USAGE
  13.  *    % fbm2tga [ image ] > image.tga
  14.  *
  15.  * EDITLOG
  16.  *    LastEditDate = Mon Jun 25 00:19:28 1990 - Michael Mauldin
  17.  *    LastFileName = /usr2/mlm/src/misc/fbm/fbm2tga.c
  18.  *
  19.  * HISTORY
  20.  * 25-Jun-90  Michael Mauldin (mlm@cs.cmu.edu) Carnegie Mellon
  21.  *    Package for Release 1.0
  22.  *
  23.  * 23-Jun-89  Michael Mauldin (mlm) at Carnegie Mellon University
  24.  *    Beta release (version 0.95) mlm@cs.cmu.edu
  25.  *    Bug fix due to Neil Crellin <neilc@natmlab.dms.oz.au>
  26.  *****************************************************************/
  27.  
  28. # include <stdio.h>
  29. # include <math.h>
  30. # include "fbm.h"
  31.  
  32. # define USAGE\
  33. "Usage: fbm2tga [ image ] > image.tga"
  34.  
  35. #ifndef lint
  36. static char *fbmid =
  37. "$FBM fbm2tga.c <1.0> 25-Jun-90  (C) 1989,1990 by Michael Mauldin, source \
  38. code available free from MLM@CS.CMU.EDU and from UUNET archives$";
  39. #endif
  40.  
  41. main (argc,argv)
  42. int argc; char *argv[];
  43. { FBM image;
  44.  
  45.   /* Clear pointers */
  46.   image.cm = image.bm = (unsigned char *) NULL;
  47.  
  48.   /* Read anything, write targa */
  49.   if (read_bitmap (&image, (argc > 0) ? argv[1] : (char *) NULL) &&
  50.       write_tga (&image, stdout))
  51.   {
  52.     exit (0);
  53.   }
  54.   else
  55.   { exit (1); }
  56. }
  57.