--BandsClientImpl.mesa --Last Edited by Pier, October 26, 1982 12:54 pm -- Last Edited by Eric Bier on October 12, 1982 6:15 pm DIRECTORY BandsClient, CGBrick, CGDevice, CGBandDevice, CopyBands, GraphicsBasic, Graphics, GraphicsOps, IO, MessageWindow, Rope, System, Time; BandsClientImpl: PROGRAM IMPORTS CGBrick, Graphics, CGBandDevice, CopyBands, GraphicsOps, IO, MessageWindow, Time EXPORTS GraphicsBasic, BandsClient = { DeviceObject: PUBLIC TYPE = CGDevice.Rep; -- exported to GraphicsBasic Device: TYPE = CGDevice.Ref; DeviceType: TYPE = CGBandDevice.BandDevice; Separation: TYPE = CGBandDevice.Separation; SetUpBrick: PUBLIC PROC [freq: REAL, angle: REAL, filter: PROC[x,y:REAL] RETURNS [fvalue: REAL]] = { CGBrick.currentBrick^ _ CGBrick.BuildBrick[freq, angle, filter]; }; OpenBands: PUBLIC PROC[bandD: DeviceType] RETURNS [dc: Graphics.Context, device: Device] = { box: Graphics.Box; device _ CGBandDevice.New[bandD]; dc _ Graphics.NewContext[device]; box _ Graphics.GetBounds[dc]; Graphics.ClipBox[dc, box]; }; --OpenBands CloseBands: PUBLIC PROC[device: Device, bandD: DeviceType] = { CGBandDevice.Close[device]; ConcatBands[bandD]; }; CloseBandsNoConcat: PUBLIC PROC[device: Device, bandD: DeviceType] = { CGBandDevice.Close[device]; }; ConcatBands: PUBLIC PROC[bandD: DeviceType] = { SELECT bandD FROM hornet => CopyBands.Copy[16]; platemaker => CopyBands.Copy[72]; ENDCASE => NULL; }; Tentfilter: PROC [x,y: REAL] RETURNS [val: REAL] = { RETURN [1.0-ABS[x]]; }; SetUpSeparation: PUBLIC PROC [s: Separation, filter: PROC[x,y:REAL] RETURNS [fvalue: REAL]] = { angle: REAL; CGBandDevice.SetSeparation[s]; angle _ SELECT s FROM red =>75, green => 105, blue => 90, none => 20, ENDCASE => ERROR; SetUpBrick[freq: 10, angle: angle, filter: filter]; }; AISBands: PUBLIC PROC [x, y: REAL, aisName: Rope.ROPE, bandD: DeviceType, s: Separation] = { dc: Graphics.Context; device: Device; ais: Graphics.ImageRef; timeStream: IO.STREAM; timeRope: Rope.ROPE; startTime, endTime: System.GreenwichMeanTime; totalTime: LONG CARDINAL; startTime _ Time.Current[]; ais _ GraphicsOps.NewAisImage[aisName]; SetUpSeparation[s, Tentfilter]; [dc, device] _ OpenBands[bandD]; Graphics.SetCP[dc, x, y]; Graphics.DrawImage[dc, ais]; CloseBands[device, bandD]; endTime _ Time.Current[]; totalTime _ endTime - startTime; timeStream _ IO.CreateOutputStreamToRope[]; timeStream.PutF["AISBands took (%r) for %g",[cardinal[totalTime]], [rope[aisName]]]; timeRope _ timeStream.GetOutputStreamRope[]; MessageWindow.Append[timeRope, TRUE]; }; -- end of AISBands AISBandsNoConcat: PUBLIC PROC [x, y: REAL, aisName: Rope.ROPE, bandD: DeviceType, s: Separation] = { dc: Graphics.Context; device: Device; ais: Graphics.ImageRef; timeStream: IO.STREAM; timeRope: Rope.ROPE; startTime, endTime: System.GreenwichMeanTime; totalTime: LONG CARDINAL; startTime _ Time.Current[]; ais _ GraphicsOps.NewAisImage[aisName]; SetUpSeparation[s, Tentfilter]; [dc, device] _ OpenBands[bandD]; Graphics.SetCP[dc, x, y]; Graphics.DrawImage[dc, ais]; CloseBandsNoConcat[device, bandD]; endTime _ Time.Current[]; totalTime _ endTime - startTime; timeStream _ IO.CreateOutputStreamToRope[]; timeStream.PutF["AISBands took (%r) for %g",[cardinal[totalTime]], [rope[aisName]]]; timeRope _ timeStream.GetOutputStreamRope[]; MessageWindow.Append[timeRope, TRUE]; }; -- end of AISBandsNoCopy }. Log Bier on October 11, 1982 11:00 am -- AISBands records the amount of time needed to make BANDS from the ais file and prints this out to the MessageWindow. Bier on October 12, 1982 6:15 pm -- Added CloseBandsNoConcat and AISBandsNoConcat ส™– "Mesa" style˜Iprocšฎฯcœฯk œsžœAžœžœ:žœžœ/žœžœœžœžœ(žœฯn œžœžœžœ žœ žœžœžœ žœ^Ÿ œžœžœ"žœฮ œŸ œžœžœdŸœžœžœNŸ œžœžœžœžœMžœžœŸ œžœžœžœžœ žœžœ Ÿœž œžœžœžœ žœžœ-žœžœEžœžœ>Ÿœžœžœžœžœwžœžœžœ=žœžœฑžœมžœœŸœžœžœžœžœvžœžœžœ=žœžœนžœมžœœ.œ3žœ_œ-˜้—…—์‹