1 LISP LIBRARY PACKAGES MANUAL 1 LISP LIBRARY PACKAGES MANUAL READAIS 1 INPUT/OUTPUT 1 READAIS 6 AIS (array of intensity samples) is a format for color and gray- level images. The following functions allow reading and writing of AIS files from Lisp. Note: The reading of an AIS file is done with the normal interrupts off. (AISBLT SourceAisFile SourceX SourceY DestinationBitmap DestinationX DestinationY Width Height How Filter Nbits LoBitAddress) [Function] Puts the image in an AIS file into a bit map. AISBLT checks the sample size of the AIS file and the number of bits per pixel of the DestinationBitmap and performs the required reduction (if any). SourceX and SourceY give the left and bottom coordinates in the source file of the image to be read (default to (0,0)). DestinationBitmap can be a bit map, a color bit map, or a window. If it is NIL, a window will be created of the proper size. How indicates what method of reduction is to be used if the sample size of the AIS file is larger than the number of bits per pixel in the destination bit map. The recognized methods are TRUNCATE (use the high-order bits) and FSA (use the Floyd-Steinberg dithering algorithm). The default when going to a 1 bpp bit map is FSA; otherwise it is TRUNCATE. Filter if non-NIL should be an array that will be used to filter the samples read from the AIS file. If Filter is given and a sample point of intensity N is read from the file, (ELT Filter N) is used to determine the bits for the destination. The function SMOOTHHIST described below is one way of getting a filter that balances the contrast in an image. Nbits and LoBitAddress allow an image to be read into one or more ©©planes'' of a color bit map. Nbits tells how many bits are to be taken from each image sample, and LoBitAddress indicates the lowest bit within each pixel that the Nbits bits are to go. (Bit address zero is the leftmost or highest-order bit. For a four-bit-per-pixel bit map, three would be the lowest-order bit.) This is used by SHOWCOLORAIS to put the different planes of a color image into the bit map. (SHOWCOLORAIS BaseFile ColorMapInfo How ColorBM SourceX SourceY DestinationX DestinationY Width Height) [Function] Reads a color image from three AIS files into a color bit map. The three color files are obtained by concatenating the strings ©©-red.ais'', ©©-green.ais'', and ©©-blue.ais``onto the end of BaseFile. If ColorMapInfo is a list of three small integers, it indicates how many of the bits in the destination are allocated to each color. For example, if ColorBM is a four-bit-per-pixel color bit map and ColorMapInfo is (1 2 1), one bit (bit zero) will be allocated to the red image, two bits (bits one and two) will be allocated to the green image, and one bit (bit three) will be allocated to the blue image. ColorBM is the color bit map the image will be stored into. It defaults to (COLORSCREENBITMAP). How, SourceX, SourceY, DestinationX, DestinationY, Width, and Height are as described in AISBLT. An experimental feature that is available only when going to 8 bpp color bit map: if ColorMapInfo is a color map, each pixel will be determined by finding the color in ColorMapInfo that is closest to the 24 bits of color information read from the three image files. (This takes a long time.) The function COLOR.DISTANCE (red green blue redentry greenentry blueentry) is called to calculate the distance by which ©©closest'' color is determined. Note: Large portions of SHOWCOLORAIS run with the standard interrupts turned off. (THREECOLORMAP RedBits GreenBits BlueBits Nbits) [Function] Returns a color map that assumes the Nbits bits are to be treated as three separate color planes with RedBits bits being in the red plane, GreenBits bits being in the green plane, and BlueBits bits being in the blue plane. Within each plane, the colors are uniformly distributed over the intensity range 0 to 255. (WRITEAIS ColorBM File Region) [Function] Writes the region Region of the color bit map ColorBM onto the file File in AIS format. This provides an efficient way of saving color or gray- level images. (AISHISTOGRAM File Region) [Function] Returns a histogram array of the region Region in the AIS file File. The histogram array has as its Nth element the number of pixels in the region that have intensity N. (GRAPHAISHISTOGRAM Histogram W) [Function] Draws a graph of a histogram array in the window W. If W is NIL, a window is created. (SMOOTHEDFILTER Histogram) [Function] Returns a ©©filter'' array that maximally distributes the intensities values contained in Histogram. The filter array can be passed to AISBLT to change the contrast of the image being read.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 247) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (270 12 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 618) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (54 12 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (270 12 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))))) .Ì øø.Ìüøø.ÌÌøø.ÌÌø ø.ÌÌøø<ø PAGEHEADING VERSOHEAD<ø PAGEHEADING RECTOHEAD;ø PAGEHEADINGFOOTINGR;ø PAGEHEADINGFOOTINGVMODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN åt …0fm^b*¤ LA 5î Y ¿ ‡+ ÃZDU G  T  %< $z  V   '"A  1  Z [Y¡zº