DIRECTORY Basics, FS, ImagerPixelMap, IO, Rope; RawEye: CEDAR PROGRAM IMPORTS FS, ImagerPixelMap, IO = BEGIN ROPE: TYPE = Rope.ROPE; PixelMap: TYPE = ImagerPixelMap.PixelMap; ReadBitmap: PROC [fileName: ROPE, byteLength, wordWidth: NAT] RETURNS [pm: PixelMap] = BEGIN file: IO.STREAM _ FS.StreamOpen[fileName: fileName, streamOptions: bmStreamOptions]; bitWidth: NAT _ wordWidth*16; bitHeight: NAT _ byteLength*8/bitWidth; gotBytes: INT; pm _ ImagerPixelMap.Create[lgBitsPerPixel: 0, bounds: [0, 0, bitHeight, bitWidth]]; TRUSTED { ub: Basics.UnsafeBlock _ [ base: LOOPHOLE[pm.refRep.pointer], startIndex: 0, count: byteLength]; gotBytes _ file.UnsafeGetBlock[ub]; }; IF gotBytes # byteLength THEN ERROR; file.Close[]; END; bmStreamOptions: FS.StreamOptions _ FS.defaultStreamOptions; bmStreamOptions[tiogaRead] _ FALSE; END. HRawEye.Mesa Last Edited by: Spreitzer, May 9, 1985 5:12:26 pm PDT Κs– "cedar" style˜J™ Jšœ5™5J˜IcodešΟk œ œœ˜/K˜šΠbxœœ˜Kšœœœ˜ —K˜Kš˜K˜Kšœœœ˜Kšœ œ˜)K˜š Οn œœ œœœ˜VKš˜Kšœœœœ@˜TKšœ œ˜Kšœ œ˜'Kšœ œ˜KšœS˜Sšœ˜ šœ˜Kšœœ˜"Kšœ˜Kšœ˜—Kšœ#˜#Kšœ˜—Kšœœœ˜$K˜ Kšœ˜—K˜Kšœ<˜