home *** CD-ROM | disk | FTP | other *** search
/ GRIPS 2: Government Rast…rocessing Software & Data / GRIPS_2.cdr / dos / seq / src / paload9.c < prev    next >
C/C++ Source or Header  |  1990-01-07  |  888b  |  53 lines

  1. /*     paload
  2. *
  3. *    Load a palette file into the display device
  4. *
  5. *    Tim Krauskopf           July 1986
  6. *
  7. *    National Center for Supercomputing Applications, University of Illinois
  8. *    153 Water Resources Building
  9. *    605 E. Springfield Ave.
  10. *    Champaign, IL 61820
  11. *    (217) 244-0072
  12. *
  13. *    this version:  no 9 revolution  display
  14. *
  15. */
  16.  
  17.  
  18. #include "stdio.h"
  19.  
  20. char rmap[256],bmap[256],gmap[256];
  21.  
  22. FILE *fp;
  23.  
  24. main(argc,argv)
  25.     int argc;
  26.     char *argv[];
  27.     {
  28.     register i;
  29.  
  30.     if (argc < 2) {
  31.         printf("\n Usage: %s file \n",argv[0]);
  32.         exit(1);
  33.     }
  34.  
  35.  
  36.     if (NULL == (fp = fopen(argv[1],"rb"))) {
  37.         puts("Error on palette file open ");
  38.         exit(2);
  39.     }
  40.  
  41.     for (i=0; i < 256 ; i++) {
  42.         fread(rmap,1,256,fp);
  43.         fread(gmap,1,256,fp);
  44.         fread(bmap,1,256,fp);
  45.    }
  46.  
  47.    fclose(fp);
  48.  
  49.     putmap(rmap,gmap,bmap);
  50.  
  51. }
  52.  
  53.