From 419a5ba10fc8a9bb34cb911fd2289b1b1c1c33a6 Mon Sep 17 00:00:00 2001 From: Jorge Rodriguez Date: Tue, 12 Aug 2014 11:55:27 -0700 Subject: [PATCH] Fix stbr__type_size for updated stbr_type --- stb_resample.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/stb_resample.h b/stb_resample.h index 711f75a..d9b3166 100644 --- a/stb_resample.h +++ b/stb_resample.h @@ -105,6 +105,13 @@ typedef enum STBR_MAX_TYPES } stbr_type; +static unsigned char stbr__type_size[] = { + 1, // STBR_TYPE_UINT8 + 2, // STBR_TYPE_UINT16 + 4, // STBR_TYPE_UINT32 + 4, // STBR_TYPE_FLOAT +}; + typedef unsigned char stbr_uint8; #ifdef _MSC_VER @@ -381,14 +388,6 @@ static unsigned char stbr__linear_uchar_to_srgb_uchar[256] = { 251, 251, 252, 252, 253, 253, 254, 254, 255 }; -static unsigned char stbr__type_size[] = { - 0, - 1, // STBR_TYPE_UINT8 - 2, // STBR_TYPE_UINT16 - 4, // STBR_TYPE_UINT32 - 4, // STBR_TYPE_FLOAT -}; - float stbr__srgb_to_linear(float f) { if (f <= 0.04045f)