Merged master into gtk3, fixed three conflicts.
This commit is contained in:
@@ -818,33 +818,21 @@ public:
|
||||
}
|
||||
}
|
||||
} else if (interp == TI_Bilinear) {
|
||||
for (int i = 0; i < nh; i++) {
|
||||
int sy = i * height / nh;
|
||||
float heightByNh = float(height) / float(nh);
|
||||
float widthByNw = float(width) / float(nw);
|
||||
float syf = 0.f;
|
||||
|
||||
if (sy >= height) {
|
||||
sy = height - 1;
|
||||
}
|
||||
for (int i = 0; i < nh; i++, syf += heightByNh) {
|
||||
int sy = syf;
|
||||
float dy = syf - float(sy);
|
||||
int ny = sy < height - 1 ? sy + 1 : sy;
|
||||
|
||||
float dy = float(i) * float(height) / float(nh) - float(sy);
|
||||
int ny = sy + 1;
|
||||
float sxf = 0.f;
|
||||
|
||||
if (ny >= height) {
|
||||
ny = sy;
|
||||
}
|
||||
|
||||
for (int j = 0; j < nw; j++) {
|
||||
int sx = j * width / nw;
|
||||
|
||||
if (sx >= width) {
|
||||
sx = width;
|
||||
}
|
||||
|
||||
float dx = float(j) * float(width) / float(nw) - float(sx);
|
||||
int nx = sx + 1;
|
||||
|
||||
if (nx >= width) {
|
||||
nx = sx;
|
||||
}
|
||||
for (int j = 0; j < nw; j++, sxf += widthByNw) {
|
||||
int sx = sxf;
|
||||
float dx = sxf - float(sx);
|
||||
int nx = sx < width - 1 ? sx + 1 : sx;
|
||||
|
||||
convertTo(r(sy, sx) * (1.f - dx) * (1.f - dy) + r(sy, nx)*dx * (1.f - dy) + r(ny, sx) * (1.f - dx)*dy + r(ny, nx)*dx * dy, imgPtr->r(i, j));
|
||||
convertTo(g(sy, sx) * (1.f - dx) * (1.f - dy) + g(sy, nx)*dx * (1.f - dy) + g(ny, sx) * (1.f - dx)*dy + g(ny, nx)*dx * dy, imgPtr->g(i, j));
|
||||
@@ -1010,9 +998,6 @@ public:
|
||||
avg_r += double(r_);
|
||||
avg_g += double(g_);
|
||||
avg_b += double(b_);
|
||||
/*avg_r += intpow( (double)r(i, j), p);
|
||||
avg_g += intpow( (double)g(i, j), p);
|
||||
avg_b += intpow( (double)b(i, j), p);*/
|
||||
n++;
|
||||
}
|
||||
|
||||
@@ -1616,9 +1601,6 @@ public:
|
||||
avg_r += double(r_);
|
||||
avg_g += double(g_);
|
||||
avg_b += double(b_);
|
||||
/*avg_r += intpow( (double)r(i, j), p);
|
||||
avg_g += intpow( (double)g(i, j), p);
|
||||
avg_b += intpow( (double)b(i, j), p);*/
|
||||
n++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user