home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GRIPS 2: Government Rast…rocessing Software & Data
/
GRIPS_2.cdr
/
dos
/
seq
/
src
/
palset9.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-07
|
1KB
|
46 lines
/*
* Program to set one color map entry in the hardware lookup table of
* a Sun.
* Tim Krauskopf August, 1987
* National Center for Supercomputing Applications
* University of Illinois
* This program is in the public domain
*
*/
#include "d:\LC\stdio.h"
#define FORMAT printf ("\nUSAGE:\n\tpalset entry_no red green blue\nOR\n\t\
palset\n")
char rmap[256],bmap[256],gmap[256];
short int count,entryNo,red,green,blue;
fixColor(entryNo,red,green,blue)
short int entryNo,red,green,blue;
{
rmap[0] = (unsigned char) red;
gmap[0] = (unsigned char) green;
bmap[0] = (unsigned char) blue;
count = 1;
#ifndef PGA
putclr (rmap, gmap, bmap, count, entryNo);
#endif
}
main(argc,argv)
int argc;
char *argv[];
{
short int test;
if (argc == 5)
fixColor(atoi(argv[1]),atoi(argv[2]),atoi(argv[3]),atoi(argv[4]));
else
if (argc != 1)
FORMAT;
else
while ((test=scanf("%d %d %d %d",&entryNo,&red,&green,&blue)) == 4)
fixColor(entryNo,red,green,blue);
}