-- JaMSnapImpl.mesa -- Last changed by Doug Wyatt, January 16, 1981 12:13 PM DIRECTORY AltoDevice USING [Bitmap, ScreenBitmap], Blt USING [Handle, New, Source, SetBox, Rect], JaMFnsDefs USING [Register, PopString], JaMGraphicsDefs USING [GetDC], JaMSnapDefs USING [], PressDefs USING [PressFileDescriptor, InitPressFileDescriptor, PutComputedDots, ClosePressFile]; JaMSnapImpl: PROGRAM IMPORTS AltoDevice, Blt, JaMFnsDefs, JaMGraphicsDefs, PressDefs EXPORTS JaMSnapDefs = { pfd: PressDefs.PressFileDescriptor; linew: CARDINAL = 40; line: ARRAY[0..linew) OF WORD; bb: Blt.Handle _ Blt.New[@line,linew]; JSnap: PROCEDURE = { bm: AltoDevice.Bitmap _ AltoDevice.ScreenBitmap[]; w: CARDINAL _ 16*bm.raster; h: CARDINAL _ bm.height; y: CARDINAL_0; NextScanLine: PROCEDURE RETURNS[POINTER] = { Blt.Rect[bb]; bb.sdy_bb.sdy-1; RETURN[@line]; }; filename: STRING _ [100]; JaMFnsDefs.PopString[filename]; Blt.Source[bb,bm.base,bm.raster]; bb.bbt.sourcetype _ block; Blt.SetBox[bb,0,0,w,1]; PressDefs.InitPressFileDescriptor[@pfd,filename]; PressDefs.PutComputedDots[p: @pfd, x: 1270, y: 26670-32*h, nPixels: w, nScanLines: h, bitsPerPixel: 0, width: 32*w, height: 32*h, nextScanLine: NextScanLine]; PressDefs.ClosePressFile[@pfd]; }; []_JaMGraphicsDefs.GetDC[]; -- to make sure it's started JaMFnsDefs.Register[".snap",JSnap]; }.(670)