SamplerRep:
TYPE ~
RECORD [
base: LONG POINTER ← NIL, -- source base address
wordsPerLine: CARDINAL ← 0, -- source words per scan line
bitsPerSample: BitsPerSample ← 0, -- source bits per sample
sSize: CARDINAL ← 0, -- source size in slow (scan line) direction
fSize: CARDINAL ← 0, -- source size in fast (pixel) direction
sMin: CARDINAL ← 0, -- source origin in slow (scan line) direction
fMin: CARDINAL ← 0, -- source origin in fast (pixel) direction
sfDelta: Basics.LongNumber ← [lc[0]], -- source delta s for destination f increment
ffDelta: Basics.LongNumber ← [lc[0]], -- source delta f for destination f increment
ssDelta: Basics.LongNumber ← [lc[0]], -- source delta s for destination s increment
fsDelta: Basics.LongNumber ← [lc[0]], -- source delta f for destination s increment
sSource: Basics.LongNumber ← [lc[0]], -- initial source s (corresponding to sDest, fDest)
fSource: Basics.LongNumber ← [lc[0]], -- initial source f (corresponding to sDest, fDest)
sDest: CARDINAL ← 0, -- initial destination s
fDest: CARDINAL ← 0 -- initial destination f
];
SetSamplerIncrements:
PROC [sampler: Sampler, m: Transformation];
Sets sfDelta, ffDelta, ssDelta, fsDelta.
SetSamplerPosition:
PROC [sampler: Sampler, m: Transformation, s, f:
CARDINAL];
Sets initial destination position.
GetPointSamples:
PROC [sampler: Sampler, s, f:
CARDINAL,
buffer: SampleBuffer, bi, bj:
NAT ← 0, count:
NAT];
buffer[bi, bj+k] ← <sample for destination>[s, f+k], for k IN[0..count)
GetInterpolatedSamples:
PROC [sampler: Sampler, s, f:
CARDINAL,
buffer: SampleBuffer, i, j:
NAT ← 0, count:
NAT];
Similar to GetPointSamples, but interpolates four surrounding samples to get result.