RASTER GRAHPICS ON THE SUN SYSTEMS Introduction The SUN raster graphics package consists of separate programs for displaying graphics images and manipulating the color palette associated with each screen. SEQ, WSEQ and MSEQ are programs which display a sequence of images, providing for non-realtime animation. SEQ works under the skeletal SUN environment; WSEQ works under SUNTOOLS;MSEQ loads all the graphics images into main memory first before sequencing the specified images to enable faster animation. GCLEAR clears the screen. PALOAD, PALSET and PALBUILD enables the user to load a color palette, modify color palette entries and build a color palette respectively. Raw Image File Format Image files are raw binary files, one byte per pixel indicating a color value from 0-255. They are interpreted as a continuous stream of bytes, i.e. the second line immediately follows the first line with no end of line or end of record marker. Color map files Raw palette files that we use consists of 256 bytes of the red entries followed by 256 bytes of the green entries and then 256 bytes of the blue entries. Each entry in the color lookup table is composed of one byte from each of the three component areas. To get the Nth entry, the Nth element(red), the (N+256)th element and the (N+512)th element are combined to get the desired RGB value for the Nth color register. Command Line Syntax The grammar that I will use for describing the commands is quite simple. The command name will be the first word on the line. This may be followed by nothing (no parameters), mandatory parameters or optional parameters. Optional parameters will be enclosed in square brackets ('[]'), and mandatory parameters will be enclosed in angle brackets ('<>'). If two items within square brackets are separated by a pipe (|), you may select one of the two, but not both. indicates an end of line. Raster Image Display Routines The basic command line for calling seq is: seq [-p xwhere ywhere][-s][-l] xdim and ydim are the xdimension and y dimension of the image file(s) which are to be displayed. -p allows the user to pick a particular location for the upper left corner of the image to be positioned. -s allows user to step through the images. -l makes the image as large as possible. 'filename(s)' specify which image(s) are to be displayed by the program. Wildcard characters can be used. Optional parameters may be specified in any order, but must occur between the image dimensions and the 'filenames'. All of the images in the sequence are interpreted as if they have the dimensions xdim,ydim. mseq [-p xwhere ywhere][-s][-l] mseq loads all the graphics images into main memory before animation. It's syntax is exactly the same as seq. (see above) wseq palet [-s] this program works under the windowing environment of SUNTOOLS. xdim and ydim are the x dimension and y dimension of the image file(s). palet specifies which color palette is to be used by wseq. -s allows the user to step through the images. 'filename(s)' specify which image(s) are to be displayed by the program. Palette Manipulation and Creation Routines. Several routines are available for the use and modification of color palettes. You can change individual entries, load entire palettes from the color palette files, and build palette files from text files. paload This routine used the raw palette file, 'filename', to initialize the hardware color lookup table. palset Entry_no is the register number of the entry that will be changed. Red, green and blue are the RGB components that will be used to initialize the entry. You can set more than one entry by using palset in interactive mode. To do this, enter palset on the command line. Palset will then accept lines of keyboard input of the form: where the meanings of the items are the same as above. palset will continue to accept lines until it sees a period as the first element on the line. For example, this interaction: palset 1 0 0 0 10 30 30 30 100 112 0 0 . will set the second color palette entry to black(0 for red, 0 for blue and 0 for green is black), the 10th entry to a shade of grey, and the 100th entry to a shade of red. You can also redirect input from a text file of this form with the same result. For example: palset < can be used to set palette entrys according to the contents of the file, 'filename'. Palbuild is a utility that you can use to create a raw palette file from text of the same form used by palset. The syntax is : palbuild or palbuild < . The first form of the command will wait for input from the keyboard terminated by a period just as palset does. The last form gets its input from the text file 'filename', again just as palset. This routine has no effect on the hardware color look-up table. Instead, it converts the input to the raw palette file format that can be used by paload. A routine called gclear is also provided. This routine simply clears the graphics buffer to all zeros. The syntax is as follows: gclear. Questions and comments: Thomas Redman University of Illinois National Center for Supercomputing Applications 152 Computing Applications Building 605 E. Springfield Ave. Champaign, IL 61820 (217)244-0072