STAMP Purpose
This procedure copies a rectangular subregion of a rectangular
array to another one, handling all the crappy edge cases.
Inputs
src: The source array (to be copied from)
x1: The lo x coordinate of the subregion to copy
y1: The lo y coordinate of the subregion to copy
dest: The destination array (to be copied to)
x2: The x coordinate in dest where x1 in src should be copied
y2: The y coordinate in dest where y1 in src should be copied
dx: The x size of the subregion to copy
dy: The y size of the subregion to copy
Keyword Parameters
add: Set to add the src region to dest
sub: Set to subtract the src region from dest
mult: Set to multiply the src region to dest
div: Set to divide the src region from dest
BEHAVIOR:
Assuming both images are big enough, the program extracts a
dx-by-dy postage stamp from src at position (x1,y1), and inserts it
into position (x2,y2) of dest. If any part of the postae stamp
falls outside of either image, those pixels are quietly ignored.
Modification History
December 2010: Written by Chris Beaumont
December 13 2010: Changed implementation for speed. The lower and
upper bounds for each array are computed directly, instead of using
index arrays and WHERE. cnb.
Aug 24 2011: Fixed a bug in handling y trimming. cnb