aboutsummaryrefslogtreecommitdiff
path: root/third-party/stb
diff options
context:
space:
mode:
authorJim Flynn <jimfly01@e127806.cambridge.arm.com>2022-06-14 10:58:23 +0100
committerNikhil Raj <nikhil.raj@arm.com>2022-07-08 15:26:05 +0100
commit6217c3d550cc8d677793b3bd5c80e2a1b3ce3bac (patch)
tree2eb16da51a5f3b2da755307b5f119a801748cb6f /third-party/stb
parent0eba1a250623025bd4ef28a43f804955201ed831 (diff)
downloadarmnn-6217c3d550cc8d677793b3bd5c80e2a1b3ce3bac.tar.gz
IVGCVSW-7024 Add missing license info for reuse lint
Signed-off-by: Jim Flynn <jim.flynn@arm.com> Change-Id: I97dee6982e0a7be01c13e9e803c0997547a39ff1
Diffstat (limited to 'third-party/stb')
-rw-r--r--third-party/stb/stb_image.h5
-rw-r--r--third-party/stb/stb_image_resize.h69
-rw-r--r--third-party/stb/stb_image_write.h35
3 files changed, 62 insertions, 47 deletions
diff --git a/third-party/stb/stb_image.h b/third-party/stb/stb_image.h
index f0cc5818de..5d4d5cf8bf 100644
--- a/third-party/stb/stb_image.h
+++ b/third-party/stb/stb_image.h
@@ -1,3 +1,8 @@
+//
+// Copyright (c) 2017 Sean Barrett
+// SPDX-License-Identifier: MIT
+//
+
/* stb_image - v2.16 - public domain image loader - http://nothings.org/stb_image.h
no warranty implied; use at your own risk
diff --git a/third-party/stb/stb_image_resize.h b/third-party/stb/stb_image_resize.h
index 858cc87fc8..cece8ef9fb 100644
--- a/third-party/stb/stb_image_resize.h
+++ b/third-party/stb/stb_image_resize.h
@@ -1,3 +1,8 @@
+//
+// Copyright (c) 2017 Sean Barrett
+// SPDX-License-Identifier: MIT
+//
+
/* stb_image_resize - v0.95 - public domain image resizing
by Jorge L Rodriguez (@VinoBS) - 2014
http://github.com/nothings/stb
@@ -20,8 +25,8 @@
output_pixels, out_w, out_h, 0,
num_channels , alpha_chan , 0)
stbir_resize_uint8_srgb_edgemode(
- input_pixels , in_w , in_h , 0,
- output_pixels, out_w, out_h, 0,
+ input_pixels , in_w , in_h , 0,
+ output_pixels, out_w, out_h, 0,
num_channels , alpha_chan , 0, STBIR_EDGE_CLAMP)
// WRAP/REFLECT/ZERO
@@ -231,7 +236,7 @@ STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , i
int num_channels);
-// The following functions interpret image data as gamma-corrected sRGB.
+// The following functions interpret image data as gamma-corrected sRGB.
// Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel,
// or otherwise provide the index of the alpha channel. Flags value
// of 0 will probably do the right thing if you're not sure what
@@ -304,19 +309,19 @@ typedef enum
STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context);
STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context);
STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
float *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context);
@@ -348,7 +353,7 @@ STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context);
@@ -356,7 +361,7 @@ STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context,
float x_scale, float y_scale,
@@ -366,7 +371,7 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context,
float s0, float t0, float s1, float t1);
@@ -668,14 +673,14 @@ static const stbir_uint32 fp32_to_srgb8_tab4[104] = {
0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559,
0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723,
};
-
+
static stbir_uint8 stbir__linear_to_srgb_uchar(float in)
{
static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps
static const stbir__FP32 minval = { (127-13) << 23 };
stbir_uint32 tab,bias,scale,t;
stbir__FP32 f;
-
+
// Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively.
// The tests are carefully written so that NaNs map to 0, same as in the reference
// implementation.
@@ -683,13 +688,13 @@ static stbir_uint8 stbir__linear_to_srgb_uchar(float in)
in = minval.f;
if (in > almostone.f)
in = almostone.f;
-
+
// Do the table lookup and unpack bias, scale
f.f = in;
tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20];
bias = (tab >> 16) << 9;
scale = tab & 0xffff;
-
+
// Grab next-highest mantissa bits and perform linear interpolation
t = (f.u >> 12) & 0xff;
return (unsigned char) ((bias + scale*t) >> 16);
@@ -2442,7 +2447,7 @@ static int stbir__resize_arbitrary(
return 0;
result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes,
- output_data, output_stride_in_bytes,
+ output_data, output_stride_in_bytes,
alpha_channel, flags, type,
edge_horizontal, edge_vertical,
colorspace, extra_memory, memory_required);
@@ -2496,7 +2501,7 @@ STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels
STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context)
{
return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
@@ -2508,7 +2513,7 @@ STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int
STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context)
{
return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
@@ -2521,7 +2526,7 @@ STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int
STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
float *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
void *alloc_context)
{
return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
@@ -2535,7 +2540,7 @@ STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context)
{
@@ -2550,7 +2555,7 @@ STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context,
float x_scale, float y_scale,
@@ -2571,7 +2576,7 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int
void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
stbir_datatype datatype,
int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
stbir_filter filter_horizontal, stbir_filter filter_vertical,
stbir_colorspace space, void *alloc_context,
float s0, float t0, float s1, float t1)
@@ -2588,20 +2593,20 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int
------------------------------------------------------------------------------
MIT License
Copyright (c) 2017 Sean Barrett
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
+The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
*/
diff --git a/third-party/stb/stb_image_write.h b/third-party/stb/stb_image_write.h
index bcbb16fff4..bf5bd1dafb 100644
--- a/third-party/stb/stb_image_write.h
+++ b/third-party/stb/stb_image_write.h
@@ -1,3 +1,8 @@
+//
+// Copyright (c) 2017 Sean Barrett
+// SPDX-License-Identifier: MIT
+//
+
/* stb_image_write - v1.06 - public domain - http://nothings.org/stb/stb_image_write.h
writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015
no warranty implied; use at your own risk
@@ -81,7 +86,7 @@ USAGE:
TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed
data, set the global variable 'stbi_write_tga_with_rle' to 0.
-
+
JPEG does ignore alpha channels in input data; quality is between 1 and 100.
Higher quality looks better but results in a bigger image.
JPEG baseline (no JPEG progressive).
@@ -114,7 +119,7 @@ CREDITS:
Thatcher Ulrich
github:poppolopoppo
Patrick Boettcher
-
+
LICENSE
See end of file for license information.
@@ -1250,7 +1255,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99};
static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,
99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
- static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
+ static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f };
int row, col, i, k;
@@ -1417,20 +1422,20 @@ STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const
------------------------------------------------------------------------------
MIT License
Copyright (c) 2017 Sean Barrett
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
+The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
*/