shithub: qk1

Download patch

ref: d0cba51c9e5c3486797d2b17c5b27b7d54628b63
parent: 18c2fe5605dfe16142b6dd4eb7356038989d5801
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Dec 21 19:59:17 EST 2023

image resize: be a bit more specific

--- a/i_resize.c
+++ b/i_resize.c
@@ -1,6 +1,5 @@
 #include "quakedef.h"
 #define STB_IMAGE_RESIZE_IMPLEMENTATION
-#define STBIR_ASSERT(x) assert(x)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
 #pragma GCC diagnostic ignored "-Warray-bounds"
@@ -10,9 +9,12 @@
 void
 pixels_resize(pixel_t *in, pixel_t *out, int iw, int ih, int ow, int oh, bool premul, bool fence)
 {
-	stbir_resize_uint8_srgb(
+	stbir_resize(
 		(byte*)in, iw, ih, iw*sizeof(pixel_t),
 		(byte*)out, ow, oh, ow*sizeof(pixel_t),
-		(premul || fence) ? STBIR_RGBA_PM : STBIR_RGBA
+		(premul || fence) ? STBIR_RGBA_PM : STBIR_RGBA,
+		STBIR_TYPE_UINT8_SRGB,
+		STBIR_EDGE_CLAMP,
+		fence ? STBIR_FILTER_BOX : STBIR_FILTER_MITCHELL
 	);
 }