int[] dataIn = this.imageInput.getData();
// offset of first pixel of the subimage within the
// larget image.
int nHOffset = this.nXOffset * this.nHorizIndex;
int nVOffset = this.nYOffset * this.nVertIndex;
Gray32OffsetImage imageResult = (Gray32OffsetImage) super.imageOutput;
imageResult.setXOffset(nHOffset);
imageResult.setYOffset(nVOffset);
int[] dataOut = imageResult.getData();
// don't access outside the image
int nLimitY = Math.min(this.imageInput.getHeight() - nVOffset, this.nHeight);
int nLimitX = Math.min(this.imageInput.getWidth() - nHOffset, this.nWidth);
for (int i=0; i<nLimitY; i++) {
int nVInLoc = i + nVOffset;