interpolateSpline(yrow, xrow, 0, gridRows, interpolated, 0, rows); interpolateSpline(yrow, xrow, 0, gridRows, interpolated, 0, rows); for (y = 0; y < rows; y++) { interpolateSpline(splines.xGrid, splines.yGrid, offset, gridCols, scale, 0, cols); scale[cols] = cols; ImageMath.resample(inPixels, intermediate, cols, y*cols, 1, scale); int offset2 = 0; for (v = 0; v < gridRows; v++) { interpolateSpline(sourceGrid.xGrid, sourceGrid.yGrid, offset, gridCols, splines.xGrid, offset2, cols); offset += gridCols; offset2 += cols; offset2 = 0; for (v = 0; v < gridRows; v++) { interpolateSpline(destGrid.xGrid, destGrid.yGrid, offset, gridCols, splines.yGrid, offset2, cols); offset += gridCols; offset2 += cols; interpolateSpline(xrow, yrow, 0, gridRows, scale, 0, rows); scale[rows] = rows; ImageMath.resample(intermediate, outPixels, rows, x, cols, scale);