/** * Get the bicubic interpolation coverage data value from the 4 x 4 coverage * data values * * @param values * coverage data values * @param sourcePixelX * source pixel x * @param sourcePixelY * source pixel y * @return bicubic coverage data value */ protected Double getBicubicInterpolationValue(Double[][] values, CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY) { return getBicubicInterpolationValue(values, sourcePixelX.getOffset(), sourcePixelY.getOffset()); }
/** * Get the Bilinear Interpolation coverage data value * * @param sourcePixelX * source pixel x * @param sourcePixelY * source pixel y * @param values * 2 x 2 coverage data values as [y][x] * @return coverage data value */ protected Double getBilinearInterpolationValue( CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY, Double[][] values) { return getBilinearInterpolationValue(sourcePixelX.getOffset(), sourcePixelY.getOffset(), sourcePixelX.getMin(), sourcePixelX.getMax(), sourcePixelY.getMin(), sourcePixelY.getMax(), values); }
int secondX; float xDistance; if (xPixel.getOffset() > .5) { firstX = xPixel.getMax(); secondX = xPixel.getMin(); xDistance = 1.0f - xPixel.getOffset(); } else { firstX = xPixel.getMin(); secondX = xPixel.getMax(); xDistance = xPixel.getOffset(); int secondY; float yDistance; if (yPixel.getOffset() > .5) { firstY = yPixel.getMax(); secondY = yPixel.getMin(); yDistance = 1.0f - yPixel.getOffset(); } else { firstY = yPixel.getMin(); secondY = yPixel.getMax(); yDistance = yPixel.getOffset(); if (xPixel.getOffset() == 0) { results.add(new int[] { xPixel.getMin() - 1, yPixel.getMin() }); results.add(new int[] { xPixel.getMin() - 1, yPixel.getMax() }); if (yPixel.getOffset() == 0) { results.add(new int[] { xPixel.getMin(), yPixel.getMin() - 1 }); results.add(new int[] { xPixel.getMax(), yPixel.getMin() - 1 });