mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
remove no-format tags and fix comment locations
This commit is contained in:
parent
4e6e69aafb
commit
48b6d4fd60
|
@ -42,12 +42,12 @@ class TestImageTransform:
|
|||
def test_extent(self):
|
||||
im = hopper("RGB")
|
||||
(w, h) = im.size
|
||||
# fmt: off
|
||||
transformed = im.transform(im.size, Image.Transform.EXTENT,
|
||||
(0, 0,
|
||||
w//2, h//2), # ul -> lr
|
||||
Image.Resampling.BILINEAR)
|
||||
# fmt: on
|
||||
transformed = im.transform(
|
||||
im.size,
|
||||
Image.Transform.EXTENT,
|
||||
(0, 0, w // 2, h // 2), # ul -> lr
|
||||
Image.Resampling.BILINEAR,
|
||||
)
|
||||
|
||||
scaled = im.resize((w * 2, h * 2), Image.Resampling.BILINEAR).crop((0, 0, w, h))
|
||||
|
||||
|
@ -58,13 +58,12 @@ class TestImageTransform:
|
|||
# one simple quad transform, equivalent to scale & crop upper left quad
|
||||
im = hopper("RGB")
|
||||
(w, h) = im.size
|
||||
# fmt: off
|
||||
transformed = im.transform(im.size, Image.Transform.QUAD,
|
||||
(0, 0, 0, h//2,
|
||||
# ul -> ccw around quad:
|
||||
w//2, h//2, w//2, 0),
|
||||
Image.Resampling.BILINEAR)
|
||||
# fmt: on
|
||||
transformed = im.transform(
|
||||
im.size,
|
||||
Image.Transform.QUAD,
|
||||
(0, 0, 0, h // 2, w // 2, h // 2, w // 2, 0), # ul -> ccw around quad
|
||||
Image.Resampling.BILINEAR,
|
||||
)
|
||||
|
||||
scaled = im.transform(
|
||||
(w, h),
|
||||
|
@ -99,16 +98,21 @@ class TestImageTransform:
|
|||
# this should be a checkerboard of halfsized hoppers in ul, lr
|
||||
im = hopper("RGBA")
|
||||
(w, h) = im.size
|
||||
# fmt: off
|
||||
transformed = im.transform(im.size, Image.Transform.MESH,
|
||||
[((0, 0, w//2, h//2), # box
|
||||
(0, 0, 0, h,
|
||||
w, h, w, 0)), # ul -> ccw around quad
|
||||
((w//2, h//2, w, h), # box
|
||||
(0, 0, 0, h,
|
||||
w, h, w, 0))], # ul -> ccw around quad
|
||||
Image.Resampling.BILINEAR)
|
||||
# fmt: on
|
||||
transformed = im.transform(
|
||||
im.size,
|
||||
Image.Transform.MESH,
|
||||
(
|
||||
(
|
||||
(0, 0, w // 2, h // 2), # box
|
||||
(0, 0, 0, h, w, h, w, 0), # ul -> ccw around quad
|
||||
),
|
||||
(
|
||||
(w // 2, h // 2, w, h), # box
|
||||
(0, 0, 0, h, w, h, w, 0), # ul -> ccw around quad
|
||||
),
|
||||
),
|
||||
Image.Resampling.BILINEAR,
|
||||
)
|
||||
|
||||
scaled = im.transform(
|
||||
(w // 2, h // 2),
|
||||
|
|
Loading…
Reference in New Issue
Block a user