summaryrefslogtreecommitdiff
path: root/core/math/math_funcs.h
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2019-05-16 23:25:48 +0200
committerGitHub <noreply@github.com>2019-05-16 23:25:48 +0200
commit05cb337f2d2276e43eb2f7bf33362f1e78204aff (patch)
tree6cbfbade8a7ca3af6e3a0cfe5772e67fb4f76465 /core/math/math_funcs.h
parent2522a432568faa32974a27ca81ead5d8aa3975ce (diff)
parent28bff3d1adce4fd7fb2e0420ff31ceb4bcc5fbad (diff)
Merge pull request #28587 from Daw11/lanczos
Implement Lanczos image filter
Diffstat (limited to 'core/math/math_funcs.h')
-rw-r--r--core/math/math_funcs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index a75f2fb4ab..82b5b56c01 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -61,6 +61,12 @@ public:
static _ALWAYS_INLINE_ double sinh(double p_x) { return ::sinh(p_x); }
static _ALWAYS_INLINE_ float sinh(float p_x) { return ::sinhf(p_x); }
+ static _ALWAYS_INLINE_ float sinc(float p_x) { return p_x == 0 ? 1 : ::sin(p_x) / p_x; }
+ static _ALWAYS_INLINE_ double sinc(double p_x) { return p_x == 0 ? 1 : ::sin(p_x) / p_x; }
+
+ static _ALWAYS_INLINE_ float sincn(float p_x) { return sinc(Math_PI * p_x); }
+ static _ALWAYS_INLINE_ double sincn(double p_x) { return sinc(Math_PI * p_x); }
+
static _ALWAYS_INLINE_ double cosh(double p_x) { return ::cosh(p_x); }
static _ALWAYS_INLINE_ float cosh(float p_x) { return ::coshf(p_x); }