[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2025-03-11 19:31:18 +00:00
parent b430b02a31
commit acde784811
2 changed files with 12 additions and 7 deletions

View File

@ -2908,7 +2908,12 @@ class Image:
Resampling.BILINEAR,
Resampling.BICUBIC,
):
if resample in (Resampling.BOX, Resampling.HAMMING, Resampling.LANCZOS, Resampling.MKS2021):
if resample in (
Resampling.BOX,
Resampling.HAMMING,
Resampling.LANCZOS,
Resampling.MKS2021,
):
unusable: dict[int, str] = {
Resampling.BOX: "Image.Resampling.BOX",
Resampling.HAMMING: "Image.Resampling.HAMMING",

View File

@ -85,16 +85,16 @@ mks_2021_filter(double x) {
if (x < 0.0)
x = -x;
if (x < 0.5)
return 577.0/576.0 - 239.0/144.0 * pow(x, 2.0);
return 577.0 / 576.0 - 239.0 / 144.0 * pow(x, 2.0);
if (x < 1.5)
return 35.0/36.0 * (x - 1.0) * (x - 239.0/140.0);
return 35.0 / 36.0 * (x - 1.0) * (x - 239.0 / 140.0);
if (x < 2.5)
return 1.0/6.0 * (x - 2.0) * (65.0/24.0 - x);
return 1.0 / 6.0 * (x - 2.0) * (65.0 / 24.0 - x);
if (x < 3.5)
return 1.0/36.0 * (x - 3.0) * (x - 15.0/4.0);
return 1.0 / 36.0 * (x - 3.0) * (x - 15.0 / 4.0);
if (x < 4.5)
return -1.0/288.0 * pow(x - 9.0/2.0, 2.0);
return(0.0);
return -1.0 / 288.0 * pow(x - 9.0 / 2.0, 2.0);
return (0.0);
}
static struct filter BOX = {box_filter, 0.5};