(FILECREATED "25-Aug-87 14:23:20" {ERINYES}<LISPUSERS>KOTO>PATCH-LARGEIPBITMAP.;1 5638 changes to: (VARS PATCH-LARGEIPBITMAPCOMS) (FNS SHOWBITMAP1.IP)) (* Copyright (c) 1987 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT PATCH-LARGEIPBITMAPCOMS) (RPAQQ PATCH-LARGEIPBITMAPCOMS ((* * Fix problem of SHOWBITMAP1.IP in Koto placing the parts of a large bitmap in the wrong order) (FNS SHOWBITMAP1.IP))) (* * Fix problem of SHOWBITMAP1.IP in Koto placing the parts of a large bitmap in the wrong order) (DEFINEQ (SHOWBITMAP1.IP [LAMBDA (IPSTREAM BITMAP LEFT FIRSTROW XPIXELS YPIXELS SCALEFACTOR ROTATION HEIGHT XBYTES REGIONBOTTOM) (* N.H.Briggs "25-Aug-87 14:06") (* jds "13-Jan-86 18:13") (* ;; "Move a segment of bitmap to an INTERPRESS file.") (* ;; "FIRSTROW is the row count -- STARTING FROM THE TOP OF THE BITMAP AS ZERO -- for the first row to be displayed.") (* ;; "By the time we get here, XBYTES should have been raised to the next multiple of 32-bits-worth, since that's the required width of packed pixel vectors." ) (PROG [(TOTALBYTES (ITIMES XBYTES YPIXELS)) (SCRATCHBM (BITMAPCREATE (CEIL XPIXELS BITSPERCELL) 1)) (BMBASE (\ADDBASE (fetch (BITMAP BITMAPBASE) of BITMAP) (ITIMES (IDIFFERENCE (IPLUS HEIGHT (OR REGIONBOTTOM 0)) (IPLUS FIRSTROW YPIXELS)) (fetch (BITMAP BITMAPRASTERWIDTH) of BITMAP] (APPENDOP.IP IPSTREAM DOSAVESIMPLEBODY) (APPENDOP.IP IPSTREAM {) (* ; "Start the SIMPLEBODY for displaying this part of the bitmap.") (TRANS.IP IPSTREAM) (* ; "Translate to the current position") (APPENDNUMBER.IP IPSTREAM YPIXELS) (* ; "For the master, this is the number of pixels in the slow direction") (APPENDNUMBER.IP IPSTREAM (CEIL XPIXELS BITSPERCELL)) (* ; "Number of pixels in the master's fast direction" ) (APPENDINTEGER.IP IPSTREAM 1) (* ; "Reserved for future expansion") (APPENDINTEGER.IP IPSTREAM 1) (APPENDINTEGER.IP IPSTREAM 1) (SELECTQ (IMOD (OR ROTATION 0) 360) (0 (* ; "Bitmaps are really shown on their sides, hanging from the upper left corner (I think--JDS)") (ROTATE.IP IPSTREAM -90) (TRANSLATE.IP IPSTREAM 0 (IPLUS FIRSTROW YPIXELS)) (* ;; "Push this segment up to its 'true' height -- i.e., The first segment gets pushed up all the way (since it's the top of the bitmap), the next segment gets pushed up HEIGHT-#ofRowsIn1stSeg (to account for the first segment), and so on." ) (CONCAT.IP IPSTREAM)) (90 (* ; "need nop") (TRANSLATE.IP IPSTREAM (IDIFFERENCE HEIGHT (IPLUS FIRSTROW YPIXELS)) 0) (* ;; "Push this segment up to its 'true' bottom -- i.e., The first segment gets pushed up to bitmapHeight-HeightOfSegment (since it's the top of the bitmap), the next segment gets pushed up HEIGHT-RowsIn1stSeg-RowsThisSeg (to account for the first segment), and so on." ) ) (180 (* ;; "The translation for this hasn't been tested yet. It may well be the inverse of the rotation-0 correction") (ROTATE.IP IPSTREAM 90) (TRANSLATE.IP IPSTREAM 0 (IPLUS FIRSTROW YPIXELS)) (CONCAT.IP IPSTREAM)) (270 (* ;; "The translation for this hasn't been tested yet. It may well be the inverse of the rotation-90 correction") (ROTATE.IP IPSTREAM 180) (TRANSLATE.IP IPSTREAM (IDIFFERENCE HEIGHT (IPLUS FIRSTROW YPIXELS)) 0) (CONCAT.IP IPSTREAM)) (ERROR ROTATION "rotation by other than multiples of 90 degrees not implemented")) (SCALE.IP IPSTREAM SCALEFACTOR) (* ; "Scale the bitmap to its final size") (CONCAT.IP IPSTREAM) (APPENDSEQUENCEDESCRIPTOR.IP IPSTREAM SEQPACKEDPIXELVECTOR (IPLUS 4 TOTALBYTES)) (APPENDINT.IP IPSTREAM 1 2) (APPENDINT.IP IPSTREAM (CEIL XPIXELS BITSPERCELL) 2) (* ;; "Now put put the bitmap -- each line must be a 32-bit multiple long") (for Y (XWORDS ← (FOLDHI XBYTES BYTESPERWORD)) from 1 to YPIXELS do (BITBLT BITMAP (OR LEFT 0) (IDIFFERENCE (IPLUS (OR REGIONBOTTOM 0) FIRSTROW YPIXELS) Y) SCRATCHBM 0 0 XPIXELS 1 (QUOTE INPUT) (QUOTE REPLACE)) (\BOUTS IPSTREAM (fetch (BITMAP BITMAPBASE) of SCRATCHBM) 0 (CEIL XBYTES BYTESPERCELL))) (APPENDOP.IP IPSTREAM MAKEPIXELARRAY) (APPENDOP.IP IPSTREAM MASKPIXEL) (APPENDOP.IP IPSTREAM }]) ) (PUTPROPS PATCH-LARGEIPBITMAP COPYRIGHT ("Xerox Corporation" 1987)) (DECLARE: DONTCOPY (FILEMAP (NIL (565 5548 (SHOWBITMAP1.IP 575 . 5546))))) STOP