mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
make perspecive transform arguments order more common
This commit is contained in:
parent
2b77b1cec7
commit
3d622d60cf
|
@ -1881,9 +1881,7 @@ class Image(object):
|
|||
|
||||
elif method == PERSPECTIVE:
|
||||
# change argument order to match implementation
|
||||
data = (data[2], data[0], data[1],
|
||||
data[5], data[3], data[4],
|
||||
data[6], data[7])
|
||||
data = data[0:8]
|
||||
|
||||
elif method == QUAD:
|
||||
# quadrilateral warp. data specifies the four corners
|
||||
|
|
|
@ -264,8 +264,8 @@ perspective_transform(double* xin, double* yin, int x, int y, void* data)
|
|||
double a3 = a[3]; double a4 = a[4]; double a5 = a[5];
|
||||
double a6 = a[6]; double a7 = a[7];
|
||||
|
||||
xin[0] = (a0 + a1*x + a2*y) / (a6*x + a7*y + 1);
|
||||
yin[0] = (a3 + a4*x + a5*y) / (a6*x + a7*y + 1);
|
||||
xin[0] = (a0*x + a1*y + a2) / (a6*x + a7*y + 1);
|
||||
yin[0] = (a3*x + a4*y + a5) / (a6*x + a7*y + 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user