6.4.7. RAW BINARY FORMAT

next, previous Section / Table of Contents / Index This format is used in saving CLUSTER or LATTICE screen graphics as pixel images on output files, see Secs. 6.2.8, 6.3.6. The images are identical to those displayed in graphics mode except that character output (used for titles, lables, and menus in the graphics window) is suppressed. Raw binary format files can be used outside BALSAC to produce image sequences for animation or fast display of fixed views. While the format is unique to BALSAC its simplicity allows easy conversion to standard pixel image formats (GIF, TIFF, PCX, etc.) to be used in a large number of commercial image processing software. As an example, this package includes a public domain utility "bin2gif" to convert raw binary format files written to GIF (graphics interchange format) type files, see Sec. 6.5.2. The raw binary file format is based on a color table of up to 256 different pixel colors which are given each by RGB values (3 x 1 byte) in the range [0,256]. Compression algorithms for file size reduction are not provided. The format is defined by a byte array given as follows: Byte 1 Number of colors NOCOLT used in the pixel image. Bytes 2 - 769 Color table definition given as R, G, B values for color # 1 (bytes number 2 - 4) R, G, B values for color # 2 (bytes number 5 - 7) ... R, G, B values for color # 256 (bytes number 767 - 769) For NOCOLT < 256 bytes number 3*NOCOLT+2 to 769 are ignored but have to be included in the file. Bytes 770, 771 Pixel image size LIMGX along the x direction given as LGIMX mod 256 (byte 770), int(LGIMX/256) (byte 771) Bytes 772, 773 Pixel image size LIMGY along the y direction given as LGIMY mod 256 (byte 772), int(LGIMY/256) (byte 773) Bytes 774 - end (end = 773 + LIMGX*LIMGY) pixel image given by the byte array ( ( p(ix,iy), ix= 1, LGIMX ), iy= 1,LGIMY ) Each byte defines the pixel color by reference to the color table. The byte sequence describes the image left to right, top to bottom. next, previous Section / Table of Contents / Index