From fc09a5d1984aab9c509667e5e164fbf39c56b383 Mon Sep 17 00:00:00 2001 From: Jorge Rodriguez Date: Tue, 12 Aug 2014 14:15:05 -0700 Subject: [PATCH] Don't saturate floats. --- stb_resample.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stb_resample.h b/stb_resample.h index 6a299f2..3321987 100644 --- a/stb_resample.h +++ b/stb_resample.h @@ -1088,15 +1088,15 @@ static stbr_inline void stbr__encode_pixel(stbr__info* stbr_info, void* output_b case STBR__DECODE(STBR_TYPE_FLOAT, STBR_COLORSPACE_LINEAR): for (n = 0; n < channels; n++) - ((float*)output_buffer)[output_pixel_index + n] = stbr__saturate(encode_buffer[encode_pixel_index + n]); + ((float*)output_buffer)[output_pixel_index + n] = encode_buffer[encode_pixel_index + n]; break; case STBR__DECODE(STBR_TYPE_FLOAT, STBR_COLORSPACE_SRGB): for (n = 0; n < channels; n++) - ((float*)output_buffer)[output_pixel_index + n] = stbr__linear_to_srgb(stbr__saturate(encode_buffer[encode_pixel_index + n])); + ((float*)output_buffer)[output_pixel_index + n] = stbr__linear_to_srgb(encode_buffer[encode_pixel_index + n]); if (stbr_info->flags&STBR_FLAG_FORCE_LINEAR_ALPHA) - ((float*)output_buffer)[output_pixel_index + alpha_channel] = stbr__saturate(encode_buffer[encode_pixel_index + alpha_channel]); + ((float*)output_buffer)[output_pixel_index + alpha_channel] = encode_buffer[encode_pixel_index + alpha_channel]; break;