-- ImageObj.mesa
-- Last changed by J Warnock, October 15, 1980 11:36 AM
DIRECTORY
Mapper USING [Handle],
Path USING [Handle];
ImageObj: DEFINITIONS = {
Handle: TYPE = LONG POINTER TO Object;
-- Client interface for a imageObj
GetScanCount: PROC[self: Handle] RETURNS[sc:CARDINAL] = INLINE {
RETURN[self.procs.GetScanCount[self]]
};
SetScanCount: PROC[self: Handle,sc:CARDINAL]= INLINE {
self.procs.SetScanCount[self,sc];
};
GetScanLength: PROC[self: Handle] RETURNS[sl:CARDINAL] = INLINE {
RETURN[self.procs.GetScanLength[self]]
};
SetScanLength: PROC[self: Handle,sl:CARDINAL]= INLINE {
self.procs.SetScanLength[self,sl];
};
GetSamplesPerPixel: PROC[self: Handle] RETURNS[spp:CARDINAL] = INLINE {
RETURN[self.procs.GetSamplesPerPixel[self]]
};
SetSamplesPerPixel: PROC[self: Handle,spp:CARDINAL]= INLINE {
self.procs.SetSamplesPerPixel[self,spp];
};
GetBitsPerSample: PROC[self: Handle] RETURNS[bps:CARDINAL] = INLINE {
RETURN[self.procs.GetBitsPerSample[self]]
};
SetBitsPerSample: PROC[self: Handle,bps:CARDINAL]= INLINE {
self.procs.SetBitsPerSample[self,bps];
};
ReadSample:PUBLIC PROCEDURE[self:Handle,x,y:REAL] RETURNS [v:CARDINAL] = INLINE {
RETURN[self.procs.ReadSample[self,x,y]]
};
SetSamplePosition:PUBLIC PROCEDURE[self:Handle,x,y,dx,dy:REAL] = INLINE {
self.procs.SetSamplePosition[self,x,y,dx,dy]
};
GetNextSample:PUBLIC PROCEDURE [self: Handle] RETURNS [CARDINAL] = INLINE {
RETURN[self.procs.GetNextSample[self]]
};
PutNextSample:PUBLIC PROCEDURE [self: Handle,v:CARDINAL] = INLINE {
self.procs.PutNextSample[self,v]
};
Reset: PROC[self: Handle]= INLINE {
self.procs.Reset[self];
};
EnumerateBoundaries: PROC[self: Handle,mapper:Mapper.Handle] RETURNS[p:Path.Handle] = INLINE {
RETURN[self.procs.EnumerateBoundaries[self,mapper]]
};
Free: PROC[selfPtr: LONG POINTER TO Handle] = INLINE {
IF selfPtr↑#NIL THEN selfPtr↑.procs.Free[selfPtr]
};
-- Actual representation for a Image interface
Object: PRIVATE TYPE = RECORD [
procs: LONG POINTER TO READONLY Procs,
data: LONG POINTER TO Data
];
Procs: PRIVATE TYPE = RECORD [
GetScanCount:PROCEDURE [self:Handle]RETURNS [sc:CARDINAL],
SetScanCount:PROCEDURE [self:Handle,sc:CARDINAL],
GetScanLength:PROCEDURE[self:Handle] RETURNS [sl:CARDINAL],
SetScanLength:PROCEDURE [self:Handle,sl:CARDINAL],
GetSamplesPerPixel:PROCEDURE[self:Handle] RETURNS[spp:CARDINAL],
SetSamplesPerPixel:PROCEDURE[self:Handle,spp:CARDINAL],
GetBitsPerSample:PROCEDURE[self:Handle] RETURNS [bps:CARDINAL],
SetBitsPerSample:PROCEDURE [self:Handle,bps:CARDINAL],
ReadSample:PUBLIC PROCEDURE[self:Handle,x,y:REAL] RETURNS [v:CARDINAL],
SetSamplePosition:PUBLIC PROCEDURE[self:Handle,x,y,dx,dy:REAL],
GetNextSample:PUBLIC PROCEDURE [self:Handle] RETURNS [CARDINAL],
PutNextSample:PUBLIC PROCEDURE [self:Handle,v:CARDINAL],
Reset:PUBLIC PROCEDURE[self:Handle],
EnumerateBoundaries:PUBLIC PROCEDURE[self:Handle,mapper:Mapper.Handle] RETURNS[p:Path.Handle],
Free:PROCEDURE [selfptr: LONG POINTER TO Handle]
];
Data: PRIVATE TYPE;
}.