mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-07 02:44:14 +03:00
add braces
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
2f0458258f
commit
91c19be6c8
|
@ -82,33 +82,43 @@ lanczos_filter(double x) {
|
|||
static inline double
|
||||
mks_2013_filter(double x) {
|
||||
/* https://johncostella.com/magic/ */
|
||||
if (x < 0.0)
|
||||
if (x < 0) {
|
||||
x = -x;
|
||||
if (x < 0.5)
|
||||
return 17.0 / 16.0 - 7.0 / 4.0 * pow(x, 2.0);
|
||||
if (x < 1.5)
|
||||
}
|
||||
if (x < 0.5) {
|
||||
return 17.0 / 16.0 - 7.0 / 4.0 * pow(x, 2);
|
||||
}
|
||||
if (x < 1.5) {
|
||||
return (1.0 - x) * (7.0 / 4.0 - x);
|
||||
if (x < 2.5)
|
||||
return -1.0 / 8.0 * pow(x - 5.0 / 2.0, 2.0);
|
||||
return (0.0);
|
||||
}
|
||||
if (x < 2.5) {
|
||||
return -1.0 / 8.0 * pow(x - 5.0 / 2.0, 2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline double
|
||||
mks_2021_filter(double x) {
|
||||
/* https://johncostella.com/magic/ */
|
||||
if (x < 0.0)
|
||||
if (x < 0) {
|
||||
x = -x;
|
||||
if (x < 0.5)
|
||||
return 577.0 / 576.0 - 239.0 / 144.0 * pow(x, 2.0);
|
||||
if (x < 1.5)
|
||||
}
|
||||
if (x < 0.5) {
|
||||
return 577.0 / 576.0 - 239.0 / 144.0 * pow(x, 2);
|
||||
}
|
||||
if (x < 1.5) {
|
||||
return 35.0 / 36.0 * (x - 1.0) * (x - 239.0 / 140.0);
|
||||
if (x < 2.5)
|
||||
}
|
||||
if (x < 2.5) {
|
||||
return 1.0 / 6.0 * (x - 2.0) * (65.0 / 24.0 - x);
|
||||
if (x < 3.5)
|
||||
}
|
||||
if (x < 3.5) {
|
||||
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);
|
||||
}
|
||||
if (x < 4.5) {
|
||||
return -1.0 / 288.0 * pow(x - 9.0 / 2.0, 2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct filter BOX = {box_filter, 0.5};
|
||||
|
|
Loading…
Reference in New Issue
Block a user