(i,j)表示 destination 目标图片中的像素点, P(x0, y0) 表示 source源图像中的像素点
P(i, j)就是要求的像素点
1.首先,计算 水平压缩因子与垂直压缩因子,
double horFactor = srcWidth / dstWidth,
double verFactor = srcHeight / dstHeight
2.计算 P(x0, y0)
double x0 = i * horFactor
double y0 = j * verFactor
3.计算 Source中 距离P(x0, y0)最近的四个像素点的坐标(x1, y1), (x1, y2), (x2, y1), (x2, y2)
x1 =int(x0)
x2 = x1 + 1
y1 = int(y0)
y2 = y1 + 1
4.计算权值
5.利用公式求解 P(i,j)