code: protected Double getBilinearInterpolationValue(float offsetX,
  			float offsetY, float minX, float maxX, float minY, float maxY,
  			Double topLeft, Double topRight, Double bottomLeft,
  			Double bottomRight) {
  
  		Double value = null;
  
  		if (topLeft != null && (topRight != null || minX == maxX)
  				&& (bottomLeft != null || minY == maxY)
  				&& (bottomRight != null || (minX == maxX && minY == maxY))) {
  
  			float diffX = maxX - minX;
  
  			double topRow;
  			Double bottomRow;
  			if (diffX == 0) {
  				topRow = topLeft;
  				bottomRow = bottomLeft;
  			} else {
  				float diffLeft = offsetX;
  				float diffRight = diffX - offsetX;
  				topRow = ((diffRight / diffX) * topLeft)
  						+ ((diffLeft / diffX) * topRight);
  				bottomRow = ((diffRight / diffX) * bottomLeft)
  						+ ((diffLeft / diffX) * bottomRight);
  			}
  
  			float diffY = maxY - minY;
  
  			double result;
  			if (diffY == 0) {
  				result = topRow;
  			} else {
  				float diffTop = offsetY;
  				float diffBottom = diffY - offsetY;
  				result = ((diffBottom / diffY) * topRow)
  						+ ((diffTop / diffY) * bottomRow);
  			}
  
  			value = result;
  		}
  
  		return value;
  	}
docs: Get the Bilinear Interpolation coverage data value
  
  @param offsetX
  x source pixel offset
  @param offsetY
  y source pixel offset
  @param minX
  min x value
  @param maxX
  max x value
  @param minY
  min y value
  @param maxY
  max y value
  @param topLeft
  top left coverage value
  @param topRight
  top right coverage value
  @param bottomLeft
  bottom left coverage value
  @param bottomRight
  bottom right coverage value
  @return coverage data value