shithub: imgtools

Download patch

ref: cd326e72db3f6609dd2093c6934f9c4b8a8abc71
parent: 3b48079fd4326acb0b4771ff7fc62e1965282492
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Apr 23 06:49:56 EDT 2021

even more

--- a/stb_image_resize.h	Fri Apr 23 06:42:18 2021
+++ b/stb_image_resize.h	Fri Apr 23 06:49:56 2021
@@ -584,21 +584,8 @@
 #undef D
 };
 
-static stbir__inline int stbir__min(int a, int b)
-{
-    return a < b ? a : b;
-}
-
-static stbir__inline float stbir__saturate(float x)
-{
-    if (x < 0)
-        return 0;
-
-    if (x > 1)
-        return 1;
-
-    return x;
-}
+#define stbir__min(a, b) ((a)<(b) ? (a) : (b))
+#define stbir__saturate(x) ((x)<0 ? 0 : ((x) > 1 ? 1 : (x)))
 
 #ifdef STBIR_SATURATE_INT
 static stbir__inline stbir_uint8 stbir__saturate8(int x)