<> <> DIRECTORY FS, GraphicsOps, IO, Rope; RawEye: CEDAR PROGRAM IMPORTS FS, GraphicsOps, IO = BEGIN ROPE: TYPE = Rope.ROPE; Bitmap: TYPE = GraphicsOps.BitmapRef; ReadBitmap: PROC [fileName: ROPE, byteLength, wordWidth: NAT] RETURNS [bm: Bitmap] = BEGIN file: IO.STREAM _ FS.StreamOpen[fileName: fileName, streamOptions: bmStreamOptions]; bitWidth: NAT _ wordWidth*16; bitHeight: NAT _ byteLength*8/bitWidth; wp: LONG POINTER TO CARDINAL; bm _ GraphicsOps.NewBitmap[bitWidth, bitHeight]; TRUSTED {wp _ LOOPHOLE[bm.base]}; FOR row: CARDINAL IN [0 .. bitHeight) DO FOR col: CARDINAL IN [0 .. wordWidth) DO word: CARDINAL _ ReadWord[file]; TRUSTED {wp^ _ word; wp _ wp + 1}; ENDLOOP; ENDLOOP; file.Close[]; END; ReadWord: PROC [file: IO.STREAM] RETURNS [word: CARDINAL] = BEGIN word _ file.GetChar[] - 0C; word _ word*256 + (file.GetChar[] - 0C); END; bmStreamOptions: FS.StreamOptions _ FS.defaultStreamOptions; bmStreamOptions[tiogaRead] _ FALSE; END.