<> <> <> <<>> <> <<>> <> <<>> <> <<>> << >> DIRECTORY Imager USING [Context], ImagerColorDefs USING [ConstantColor], ImagerDevice USING[Device], ImagerPixelMap USING [PixelMap], ImagerSample USING [SampleBuffer], ImagerTransformation USING [Transformation]; ImagerFunctionDevice: CEDAR DEFINITIONS ~ BEGIN OPEN Imager, ImagerPixelMap, ImagerTransformation; SampleBuffer: TYPE ~ ImagerSample.SampleBuffer; ClientFunc: TYPE = PROC [fMin, fSize: NAT, colorSamples, deviceSamples: SampleBuffer] ; Create: PROC [ samplesPerPixel:NAT, -- colorToSampleProc will generate this many 16 bit samples per pixel devicePms: LIST OF PixelMap, -- where this device stores the image deviceToPixel: Transformation _ NIL, -- transformation from device space initialScale: REAL _ 1.0, -- 1 unit = 1 pixel clientFunc: ClientFunc _ NIL -- devicePms _ clientFunc(devicePms, color) ] RETURNS [Context]; <> <<>> <> CreateFromDevice: PROC [ device: ImagerDevice.Device, initialScale: REAL _ 1.0 -- 1 unit = 1 pixel ] RETURNS [Context]; DeviceFromPixelMap: PROC [ samplesPerPixel:NAT, pms: LIST OF PixelMap, deviceToPixel: Transformation, clientFunc: ClientFunc ] RETURNS [ImagerDevice.Device] ; <<-- As above but only creates a device - useful for ambushes!>> LikeScreen: PROC [sSize: NAT] RETURNS [Transformation]; <> <<>> MakeConstantColor: PROC [sample: SampleBuffer] RETURNS [color: ImagerColorDefs.ConstantColor] ; MakePMS: PROC [n, sSize, fSize:NAT] RETURNS [LIST OF PixelMap] ; <> END.