home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GRIPS 2: Government Rast…rocessing Software & Data
/
GRIPS_2.cdr
/
dos
/
seq
/
src
/
palsave9.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-07
|
987b
|
55 lines
/* 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);
}