ImagerDevice.mesa
Last Edited by:
Crow, June 18, 1983 11:27 am
DIRECTORY
ImagerBasic  USING [ImagingDevice, InteractiveImagingDevice],
ImagerInternalDefs USING [TransformRecord, ClipperRecord, PixelBox, RGBValue];
ImagerDevice: CEDAR DEFINITIONS
= BEGIN
Basic Definitions (Numbers and Shapes)
Devices
PxlValue: TYPE = LONG CARDINAL;
ByteSequence: TYPE = REF ByteSequenceRep;
ByteSequenceRep: TYPE = RECORD [PACKED SEQUENCE COMPUTED CARDINAL OF [0..256)];
SetUpProc:   TYPE = PROC [] RETURNS [REF TransformRecord, REF ClipperRecord,
DisplayProcs]; -- get memory, pin it, set the transform, clipper, and device procs
ShutDownProc: TYPE = PROC [];        -- free memory
OpenPixelBufferProc: TYPE = PROC [buffer: PixelBox ← NIL] RETURNS [PixelBox]; -- redirect writes for double-buffer
ClosePixelBufferProc: TYPE = PROC [];       -- drop pixel buffer ref       
RGBtoPixelProc: TYPE = PROC [color: RGBValue] RETURNS [PxlValue]; -- Color to device transform
PixeltoRGBProc: TYPE = PROC [pxlValue: PxlValue] RETURNS [RGBValue];
HilitePxlsProc: TYPE = PROC [area: IntRectangle]; -- Device dependent highlighting scheme
MovePxlsProc: TYPE = PROC [source: IntRectangle, destination: IntVec]; -- move on display
GetPxlsProc:  TYPE = PROC [source: IntRectangle] RETURNS [PixelBox];
LoadPxlsProc: TYPE = PROC [source: PixelBox ← NIL, destination: IntVec];
LoadScanSegProc: TYPE = PROC [x, y, length: CARDINAL, segment: ByteSequence];
LoadTrapezoidProc: TYPE = PROC [top, bottom, leftTop, leftBot, rightTop, rightBot: CARDINAL, pxlValue: PxlValue];        -- Scan convert trapezoid, constant color
SetPixelProc:  TYPE = PROC [x, y: CARDINAL, pxlValue: PxlValue];
GetPixelProc:  TYPE = PROC [x, y: CARDINAL] RETURNS [PxlValue];
DrawLineProc: TYPE = PROC [a, b: IntVec, pxlValue: PxlValue]; -- fast line, constant color
DisplayProcs: TYPE = REF DisplayProcsRec;
DisplayProcsRec: TYPE = RECORD[
setUp: SetUpProc,
shutDown: ShutDownProc,
openPixelBuffer: OpenPixelBufferProc,
closePixelBuffer: ClosePixelBufferProc,
RGBtoPixel: RGBtoPixelProc,
pixeltoRGB: PixeltoRGBProc,
hilitePxls: HilitePxlsProc,
movePxls: MovePxlsProc,
getPxls: GetPxlsProc,
loadPxls: LoadPxlsProc,
loadScanSeg: LoadScanSegProc,
loadTrapezoid: LoadTrapezoidProc,
setPixel: SetPixelProc,
getPixel: GetPixelProc,
drawLine: DrawLineProc
];  -- this doesn't seem to help PD and InterPress master devices much, what to do??
END.