update stb_image version & changelog
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent f9e593c · Browse files · 2 files·+29 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+29 added−20 removed
- other:+29 added−20 removed
Provenance
- Commit
91255cb- Tree
83ff88e- Author
Sean Barrett <sean2@nothings.org>- Committer
Sean Barrett <sean2@nothings.org>- Parent
f9e593c
2 files changed+29 added−20 removed
modified:README.md+1 added-1 removed
4 unmodified lines5678991011121374 unmodified lines4 unmodified lines
library | lastest version | category | description--------------------- | ---- | -------- | --------------------------------**stb_vorbis.c** | 1.04 | audio | decode ogg vorbis files from file/memory to float/16-bit signed output**stb_image.h** | 1.46 | graphics | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC**stb_image.h** | 1.47 | graphics | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC**stb_truetype.h** | 1.02 | graphics | parse, decode, and rasterize characters from truetype fonts**stb_image_write.h** | 0.95 | graphics | image writing to disk: PNG, TGA, BMP**stb_image_resize.h** | 0.90 | graphics | resize images larger/smaller with good quality**stb_rect_pack.h** | 0.05 | graphics | simple 2D rectangle packer with decent quality74 unmodified linesmodified:stb_image.h+28 added-19 removed
1-/* stb_image - v1.46 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c1+/* stb_image - v1.47 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c2 when you control the images you're loading3 no warranty implied; use at your own risk4 5 Do this:21 unmodified lines27 - decode from arbitrary I/O callbacks28 - overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)29 30 Latest revisions:31- 1.xx (2014-09-26) 1/2/4-bit PNG support (both grayscale and paletted)31+ 1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)32+ optimize PNG33+ fix bug in interlaced PNG with user-specified channel count34 1.46 (2014-08-26) fix broken tRNS chunk in non-paletted PNG35 1.45 (2014-08-16) workaround MSVC-ARM internal compiler error by wrapping malloc36 1.44 (2014-08-07) warnings37 1.43 (2014-07-15) fix MSVC-only bug in 1.4238 1.42 (2014-07-09) no _CRT_SECURE_NO_WARNINGS; error-path fixes; STBI_ASSERT39 1.41 (2014-06-25) fix search&replace that messed up comments/error messages38- 1.40 (2014-06-22) gcc warning39- 1.39 (2014-06-15) TGA optimization bugfix, multiple BMP fixes40- 1.38 (2014-06-06) suppress MSVC run-time warnings, fix accidental rename of 'skip'41- 1.37 (2014-06-04) remove duplicate typedef42- 1.36 (2014-06-03) converted to header file, allow reading incorrect iphoned-images without iphone flag43- 1.35 (2014-05-27) warnings, bugfixes, TGA optimization, etc40 41 See end of file for full revision history.42 43 TODO:2410 unmodified lines2454 stbi__uint32 length;2455 stbi__uint32 type;2456 } stbi__pngchunk;2457 2462-#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))2463-2458 static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)2459 {2460 stbi__pngchunk c;2461 c.length = stbi__get32be(s);17 unmodified lines2479 } stbi__png;2480 2481 2482 enum {2489- STBI__F_none=0, STBI__F_sub=1, STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4,2490- STBI__F_avg_first, STBI__F_paeth_first2483+ STBI__F_none=0,2484+ STBI__F_sub=1,2485+ STBI__F_up=2,2486+ STBI__F_avg=3,2487+ STBI__F_paeth=4,2488+ // synthetic filters used for first scanline to avoid needing a dummy row of 0s2489+ STBI__F_avg_first,2490+ STBI__F_paeth_first2491 };2492 2493 static stbi_uc first_row_filter[5] =2494 {2495- STBI__F_none, STBI__F_sub, STBI__F_none, STBI__F_avg_first, STBI__F_paeth_first2495+ STBI__F_none,2496+ STBI__F_sub,2497+ STBI__F_none,2498+ STBI__F_avg_first,2499+ STBI__F_paeth_first2500 };2501 2502 static int stbi__paeth(int a, int b, int c)2503 {347 unmodified lines2851 }2852 }2853 }2854 2855+#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))2856+2857 static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)2858 {2859 stbi_uc palette[1024], pal_img_n=0;2860 stbi_uc has_trans=0, tc[3];11 unmodified lines2872 2873 for (;;) {2874 stbi__pngchunk c = stbi__get_chunk_header(s);2875 switch (c.type) {2870- case PNG_TYPE('C','g','B','I'):2876+ case STBI__PNG_TYPE('C','g','B','I'):2877 is_iphone = 1;2878 stbi__skip(s, c.length);2879 break;2874- case PNG_TYPE('I','H','D','R'): {2880+ case STBI__PNG_TYPE('I','H','D','R'): {2881 int comp,filter;2882 if (!first) return stbi__err("multiple IHDR","Corrupt PNG");2883 first = 0;2884 if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");19 unmodified lines2904 }2905 break;2906 }2907 2902- case PNG_TYPE('P','L','T','E'): {2908+ case STBI__PNG_TYPE('P','L','T','E'): {2909 if (first) return stbi__err("first not IHDR", "Corrupt PNG");2910 if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");2911 pal_len = c.length / 3;2912 if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");5 unmodified lines2918 }2919 break;2920 }2921 2916- case PNG_TYPE('t','R','N','S'): {2922+ case STBI__PNG_TYPE('t','R','N','S'): {2923 if (first) return stbi__err("first not IHDR", "Corrupt PNG");2924 if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");2925 if (pal_img_n) {2926 if (scan == SCAN_header) { s->img_n = 4; return 1; }11 unmodified lines2938 }2939 break;2940 }2941 2936- case PNG_TYPE('I','D','A','T'): {2942+ case STBI__PNG_TYPE('I','D','A','T'): {2943 if (first) return stbi__err("first not IHDR", "Corrupt PNG");2944 if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");2945 if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; }2946 if (ioff + c.length > idata_limit) {8 unmodified lines2955 ioff += c.length;2956 break;2957 }2958 2953- case PNG_TYPE('I','E','N','D'): {2959+ case STBI__PNG_TYPE('I','E','N','D'): {2960 stbi__uint32 raw_len;2961 if (first) return stbi__err("first not IHDR", "Corrupt PNG");2962 if (scan != SCAN_load) return 1;2963 if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");1741 unmodified lines4705 #endif // STB_IMAGE_IMPLEMENTATION4706 4707 /*4708 revision history:4709+ 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)4710+ optimize PNG (ryg)4711+ fix bug in interlaced PNG with user-specified channel count (stb)4712 1.46 (2014-08-26)4713 fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG4714 1.45 (2014-08-16)4715 fix MSVC-ARM internal compiler error by wrapping malloc116 unmodified lines