home *** CD-ROM | disk | FTP | other *** search
- /* palsave
- *
- * Program to copy the contents of the hardware frame buffer's lookup table
- * to a disk file.
- * Tim Krauskopf August 1987
- * National Center for Supercomputing Applications
- * University of Illinois
- * This program is in the public domain
- *
- */
- #include "pixrect/pixrect_hs.h"
- #include "stdio.h"
-
- char rmap[256],bmap[256],gmap[256];
-
- struct pixrect *screen;
-
- FILE *fp;
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- register i;
-
- if (argc < 2) {
- printf("\n Usage: %s file \n",argv[0]);
- exit(1);
- }
-
- screen = pr_open("/dev/fb");
- pr_getcolormap(screen,0,256,rmap,gmap,bmap);
- pr_close(screen);
-
- if (0 > creat(argv[1],0777)) {
- puts("Error in creating new file");
- exit(2);
- }
-
- if (NULL == (fp = fopen(argv[1],"w"))) {
- puts("Error on palette file open ");
- exit(2);
- }
- fwrite(rmap,1,256,fp);
- fwrite(gmap,1,256,fp);
- fwrite(bmap,1,256,fp);
-
- fclose(fp);
-
- }
-
-
-
-
-