From 7da729bfce662e9c8a69beb2a5024a33a0af694f Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Sun, 7 Sep 2014 04:07:07 -0700 Subject: [PATCH] restore correct definition of box --- stb_image_resize.h | 4 +--- tests/resample_test.cpp | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/stb_image_resize.h b/stb_image_resize.h index a1949b5..0322743 100644 --- a/stb_image_resize.h +++ b/stb_image_resize.h @@ -1,5 +1,3 @@ -#define STBIR_DEBUG_OVERWRITE_TEST - /* stb_image_resize - v0.50 - public domain image resampling no warranty implied; use at your own risk @@ -507,7 +505,7 @@ static unsigned char stbir__linear_to_srgb_uchar(float f) static float stbir__filter_box(float x) { - if (x < -0.5f) + if (x <= -0.5f) return 0; else if (x > 0.5f) return 0; diff --git a/tests/resample_test.cpp b/tests/resample_test.cpp index 77d8437..5cc1518 100644 --- a/tests/resample_test.cpp +++ b/tests/resample_test.cpp @@ -720,5 +720,3 @@ void test_suite(int argc, char **argv) resize_image("gamma_2.2.jpg", .5f, .5f, STBIR_FILTER_CATMULLROM, STBIR_EDGE_REFLECT, STBIR_COLORSPACE_SRGB, "test-output/gamma_2.2.jpg"); resize_image("gamma_dalai_lama_gray.jpg", .5f, .5f, STBIR_FILTER_CATMULLROM, STBIR_EDGE_REFLECT, STBIR_COLORSPACE_SRGB, "test-output/gamma_dalai_lama_gray.jpg"); } - -