├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── 1-stb_image-doesn-t-load-specific-image-correctly.md │ ├── 2-bug_report.md │ ├── 3-feature_request.md │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── ci-fuzz.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── SECURITY.md ├── data ├── atari_8bit_font_revised.png ├── easy_font_raw.png ├── herringbone │ ├── license.txt │ ├── template_caves_limit_connectivity.png │ ├── template_caves_tiny_corridors.png │ ├── template_corner_caves.png │ ├── template_horizontal_corridors_v1.png │ ├── template_horizontal_corridors_v2.png │ ├── template_horizontal_corridors_v3.png │ ├── template_limit_connectivity_fat.png │ ├── template_limited_connectivity.png │ ├── template_maze_2_wide.png │ ├── template_maze_plus_2_wide.png │ ├── template_open_areas.png │ ├── template_ref2_corner_caves.png │ ├── template_rooms_and_corridors.png │ ├── template_rooms_and_corridors_2_wide_diagonal_bias.png │ ├── template_rooms_limit_connectivity.png │ ├── template_round_rooms_diagonal_corridors.png │ ├── template_sean_dungeon.png │ ├── template_simple_caves_2_wide.png │ └── template_square_rooms_with_random_rects.png ├── map_01.png ├── map_02.png └── map_03.png ├── deprecated ├── rrsprintf.h ├── stb.h ├── stb_image.c ├── stb_image_resize.h ├── stretch_test.c ├── stretchy_buffer.h └── stretchy_buffer.txt ├── docs ├── other_libs.md ├── stb_howto.txt ├── stb_voxel_render_interview.md └── why_public_domain.md ├── stb_c_lexer.h ├── stb_connected_components.h ├── stb_divide.h ├── stb_ds.h ├── stb_dxt.h ├── stb_easy_font.h ├── stb_herringbone_wang_tile.h ├── stb_hexwave.h ├── stb_image.h ├── stb_image_resize2.h ├── stb_image_resize_test ├── dotimings.c ├── old_image_resize.h ├── oldir.c ├── stbirtest.c └── vf_train.c ├── stb_image_write.h ├── stb_include.h ├── stb_leakcheck.h ├── stb_perlin.h ├── stb_rect_pack.h ├── stb_sprintf.h ├── stb_textedit.h ├── stb_tilemap_editor.h ├── stb_truetype.h ├── stb_vorbis.c ├── stb_voxel_render.h ├── tests ├── Makefile ├── c_lexer_test.c ├── c_lexer_test.dsp ├── caveview │ ├── README.md │ ├── cave_main.c │ ├── cave_mesher.c │ ├── cave_parse.c │ ├── cave_parse.h │ ├── cave_render.c │ ├── caveview.dsp │ ├── caveview.dsw │ ├── caveview.h │ ├── glext.h │ ├── glext_list.h │ ├── main.c │ ├── stb_gl.h │ ├── stb_glprog.h │ └── win32 │ │ └── SDL_windows_main.c ├── fuzz_main.c ├── grid_reachability.c ├── herringbone.dsp ├── herringbone_generator.c ├── herringbone_map.c ├── herringbone_map.dsp ├── image_test.c ├── image_test.dsp ├── image_write_test.c ├── ossfuzz.sh ├── oversample │ ├── README.md │ ├── main.c │ ├── oversample.dsp │ ├── oversample.dsw │ ├── oversample.exe │ └── stb_wingraph.h ├── pbm │ ├── basi0g16.pgm │ ├── basi2c16.ppm │ ├── cdfn2c08.ppm │ ├── cdun2c08.ppm │ ├── comment.pgm │ └── ctfn0g04.pgm ├── pg_test │ └── pg_test.c ├── pngsuite │ ├── 16bit │ │ ├── basi0g16.png │ │ ├── basi2c16.png │ │ ├── basi4a16.png │ │ ├── basi6a16.png │ │ ├── basn0g16.png │ │ ├── basn2c16.png │ │ ├── basn4a16.png │ │ ├── basn6a16.png │ │ ├── bgai4a16.png │ │ ├── bgan6a16.png │ │ ├── bggn4a16.png │ │ ├── bgyn6a16.png │ │ ├── oi1n0g16.png │ │ ├── oi1n2c16.png │ │ ├── oi2n0g16.png │ │ ├── oi2n2c16.png │ │ ├── oi4n0g16.png │ │ ├── oi4n2c16.png │ │ ├── oi9n0g16.png │ │ ├── oi9n2c16.png │ │ ├── tbbn2c16.png │ │ ├── tbgn2c16.png │ │ └── tbwn0g16.png │ ├── PngSuite.LICENSE │ ├── corrupt │ │ ├── xc1n0g08.png │ │ ├── xc9n2c08.png │ │ ├── xcrn0g04.png │ │ ├── xcsn0g01.png │ │ ├── xd0n2c08.png │ │ ├── xd3n2c08.png │ │ ├── xd9n2c08.png │ │ ├── xdtn0g01.png │ │ ├── xhdn0g08.png │ │ ├── xlfn0g04.png │ │ ├── xs1n0g01.png │ │ ├── xs2n0g01.png │ │ ├── xs4n0g01.png │ │ └── xs7n0g01.png │ ├── iphone │ │ ├── iphone_basi0g01.png │ │ ├── iphone_basi0g02.png │ │ ├── iphone_basi3p02.png │ │ ├── iphone_bgwn6a08.png │ │ ├── iphone_bgyn6a16.png │ │ ├── iphone_tbyn3p08.png │ │ └── iphone_z06n2c08.png │ ├── primary │ │ ├── basi0g01.png │ │ ├── basi0g02.png │ │ ├── basi0g04.png │ │ ├── basi0g08.png │ │ ├── basi2c08.png │ │ ├── basi3p01.png │ │ ├── basi3p02.png │ │ ├── basi3p04.png │ │ ├── basi3p08.png │ │ ├── basi4a08.png │ │ ├── basi6a08.png │ │ ├── basn0g01.png │ │ ├── basn0g02.png │ │ ├── basn0g04.png │ │ ├── basn0g08.png │ │ ├── basn2c08.png │ │ ├── basn3p01.png │ │ ├── basn3p02.png │ │ ├── basn3p04.png │ │ ├── basn3p08.png │ │ ├── basn4a08.png │ │ ├── basn6a08.png │ │ ├── bgai4a08.png │ │ ├── bgan6a08.png │ │ ├── bgbn4a08.png │ │ ├── bgwn6a08.png │ │ ├── s01i3p01.png │ │ ├── s01n3p01.png │ │ ├── s02i3p01.png │ │ ├── s02n3p01.png │ │ ├── s03i3p01.png │ │ ├── s03n3p01.png │ │ ├── s04i3p01.png │ │ ├── s04n3p01.png │ │ ├── s05i3p02.png │ │ ├── s05n3p02.png │ │ ├── s06i3p02.png │ │ ├── s06n3p02.png │ │ ├── s07i3p02.png │ │ ├── s07n3p02.png │ │ ├── s08i3p02.png │ │ ├── s08n3p02.png │ │ ├── s09i3p02.png │ │ ├── s09n3p02.png │ │ ├── s32i3p04.png │ │ ├── s32n3p04.png │ │ ├── s33i3p04.png │ │ ├── s33n3p04.png │ │ ├── s34i3p04.png │ │ ├── s34n3p04.png │ │ ├── s35i3p04.png │ │ ├── s35n3p04.png │ │ ├── s36i3p04.png │ │ ├── s36n3p04.png │ │ ├── s37i3p04.png │ │ ├── s37n3p04.png │ │ ├── s38i3p04.png │ │ ├── s38n3p04.png │ │ ├── s39i3p04.png │ │ ├── s39n3p04.png │ │ ├── s40i3p04.png │ │ ├── s40n3p04.png │ │ ├── tbbn0g04.png │ │ ├── tbbn3p08.png │ │ ├── tbgn3p08.png │ │ ├── tbrn2c08.png │ │ ├── tbwn3p08.png │ │ ├── tbyn3p08.png │ │ ├── tm3n3p02.png │ │ ├── tp0n0g08.png │ │ ├── tp0n2c08.png │ │ ├── tp0n3p08.png │ │ ├── tp1n3p08.png │ │ ├── z00n2c08.png │ │ ├── z03n2c08.png │ │ ├── z06n2c08.png │ │ └── z09n2c08.png │ ├── primary_check │ │ ├── basi0g01.png │ │ ├── basi0g02.png │ │ ├── basi0g04.png │ │ ├── basi0g08.png │ │ ├── basi2c08.png │ │ ├── basi3p01.png │ │ ├── basi3p02.png │ │ ├── basi3p04.png │ │ ├── basi3p08.png │ │ ├── basi4a08.png │ │ ├── basi6a08.png │ │ ├── basn0g01.png │ │ ├── basn0g02.png │ │ ├── basn0g04.png │ │ ├── basn0g08.png │ │ ├── basn2c08.png │ │ ├── basn3p01.png │ │ ├── basn3p02.png │ │ ├── basn3p04.png │ │ ├── basn3p08.png │ │ ├── basn4a08.png │ │ ├── basn6a08.png │ │ ├── bgai4a08.png │ │ ├── bgan6a08.png │ │ ├── bgbn4a08.png │ │ ├── bgwn6a08.png │ │ ├── s01i3p01.png │ │ ├── s01n3p01.png │ │ ├── s02i3p01.png │ │ ├── s02n3p01.png │ │ ├── s03i3p01.png │ │ ├── s03n3p01.png │ │ ├── s04i3p01.png │ │ ├── s04n3p01.png │ │ ├── s05i3p02.png │ │ ├── s05n3p02.png │ │ ├── s06i3p02.png │ │ ├── s06n3p02.png │ │ ├── s07i3p02.png │ │ ├── s07n3p02.png │ │ ├── s08i3p02.png │ │ ├── s08n3p02.png │ │ ├── s09i3p02.png │ │ ├── s09n3p02.png │ │ ├── s32i3p04.png │ │ ├── s32n3p04.png │ │ ├── s33i3p04.png │ │ ├── s33n3p04.png │ │ ├── s34i3p04.png │ │ ├── s34n3p04.png │ │ ├── s35i3p04.png │ │ ├── s35n3p04.png │ │ ├── s36i3p04.png │ │ ├── s36n3p04.png │ │ ├── s37i3p04.png │ │ ├── s37n3p04.png │ │ ├── s38i3p04.png │ │ ├── s38n3p04.png │ │ ├── s39i3p04.png │ │ ├── s39n3p04.png │ │ ├── s40i3p04.png │ │ ├── s40n3p04.png │ │ ├── tbbn0g04.png │ │ ├── tbbn3p08.png │ │ ├── tbgn3p08.png │ │ ├── tbrn2c08.png │ │ ├── tbwn3p08.png │ │ ├── tbyn3p08.png │ │ ├── tm3n3p02.png │ │ ├── tp0n0g08.png │ │ ├── tp0n2c08.png │ │ ├── tp0n3p08.png │ │ ├── tp1n3p08.png │ │ ├── z00n2c08.png │ │ ├── z03n2c08.png │ │ ├── z06n2c08.png │ │ └── z09n2c08.png │ ├── ref_results.csv │ └── unused │ │ ├── ccwn2c08.png │ │ ├── ccwn3p08.png │ │ ├── cdfn2c08.png │ │ ├── cdhn2c08.png │ │ ├── cdsn2c08.png │ │ ├── cdun2c08.png │ │ ├── ch1n3p04.png │ │ ├── ch2n3p08.png │ │ ├── cm0n0g04.png │ │ ├── cm7n0g04.png │ │ ├── cm9n0g04.png │ │ ├── cs3n2c16.png │ │ ├── cs3n3p08.png │ │ ├── cs5n2c08.png │ │ ├── cs5n3p08.png │ │ ├── cs8n2c08.png │ │ ├── cs8n3p08.png │ │ ├── ct0n0g04.png │ │ ├── ct1n0g04.png │ │ ├── cten0g04.png │ │ ├── ctfn0g04.png │ │ ├── ctgn0g04.png │ │ ├── cthn0g04.png │ │ ├── ctjn0g04.png │ │ ├── ctzn0g04.png │ │ ├── f00n0g08.png │ │ ├── f00n2c08.png │ │ ├── f01n0g08.png │ │ ├── f01n2c08.png │ │ ├── f02n0g08.png │ │ ├── f02n2c08.png │ │ ├── f03n0g08.png │ │ ├── f03n2c08.png │ │ ├── f04n0g08.png │ │ ├── f04n2c08.png │ │ ├── f99n0g04.png │ │ ├── g03n0g16.png │ │ ├── g03n2c08.png │ │ ├── g03n3p04.png │ │ ├── g04n0g16.png │ │ ├── g04n2c08.png │ │ ├── g04n3p04.png │ │ ├── g05n0g16.png │ │ ├── g05n2c08.png │ │ ├── g05n3p04.png │ │ ├── g07n0g16.png │ │ ├── g07n2c08.png │ │ ├── g07n3p04.png │ │ ├── g10n0g16.png │ │ ├── g10n2c08.png │ │ ├── g10n3p04.png │ │ ├── g25n0g16.png │ │ ├── g25n2c08.png │ │ ├── g25n3p04.png │ │ ├── pp0n2c16.png │ │ ├── pp0n6a08.png │ │ ├── ps1n0g08.png │ │ ├── ps1n2c16.png │ │ ├── ps2n0g08.png │ │ └── ps2n2c16.png ├── prerelease │ └── stb_lib.h ├── resample_test.cpp ├── resample_test_c.c ├── resize.dsp ├── sdf │ ├── sdf_test.c │ ├── sdf_test_arial_16.png │ ├── sdf_test_times_16.png │ └── sdf_test_times_50.png ├── stb.c ├── stb.dsp ├── stb.dsw ├── stb_c_lexer_fuzzer.cpp ├── stb_cpp.cpp ├── stb_cpp.dsp ├── stb_png.dict ├── stb_static.c ├── stbi_read_fuzzer.c ├── stblib.dsp ├── stblib_test.c ├── stblib_test_companion.c ├── stretch_test.dsp ├── test.sbm ├── test_c_compilation.c ├── test_c_lexer.c ├── test_cpp_compilation.cpp ├── test_ds.c ├── test_ds_cpp.cpp ├── test_dxt.c ├── test_easyfont.c ├── test_image.c ├── test_image_write.c ├── test_perlin.c ├── test_png_paeth.c ├── test_png_regress.c ├── test_siphash.c ├── test_sprintf.c ├── test_truetype.c ├── test_vorbis.c ├── test_voxel.c ├── textedit_sample.c ├── tilemap_editor_integration_example.c ├── truetype_test_win32.c └── vorbseek │ ├── vorbseek.c │ └── vorbseek.dsp └── tools ├── README.footer.md ├── README.header.md ├── README.list ├── build_matrix.c ├── easy_font_maker.c ├── make_readme.c ├── make_readme.dsp ├── mr.bat ├── trailing_whitespace.c ├── unicode.c └── unicode └── unicode.dsp /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Pull Requests and Issues are both welcome. 2 | 3 | # Responsiveness 4 | 5 | General priority order is: 6 | 7 | * Crashes 8 | * Security issues in stb_image 9 | * Bugs 10 | * Security concerns in other libs 11 | * Warnings 12 | * Enhancements (new features, performance improvement, etc) 13 | 14 | Pull requests get priority over Issues. Some pull requests I take 15 | as written; some I modify myself; some I will request changes before 16 | accepting them. Because I've ended up supporting a lot of libraries 17 | (20 as I write this, with more on the way), I am somewhat slow to 18 | address things. Many issues have been around for a long time. 19 | 20 | # Pull requests 21 | 22 | * Make sure you're using a special branch just for this pull request. (Sometimes people unknowingly use a default branch, then later update that branch, which updates the pull request with the other changes if it hasn't been merged yet.) 23 | * Do NOT update the version number in the file. (This just causes conflicts.) 24 | * Do add your name to the list of contributors. (Don't worry about the formatting.) I'll try to remember to add it if you don't, but I sometimes forget as it's an extra step. 25 | * Your change needs to compile as both C and C++. Pre-C99 compilers should be supported (e.g. declare at start of block) 26 | 27 | # Specific libraries 28 | 29 | I generally do not want new file formats for stb_image because 30 | we are trying to improve its security, so increasing its attack 31 | surface is counter-productive. 32 | 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1-stb_image-doesn-t-load-specific-image-correctly.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: stb_image Doesn't Load Specific Image Correctly 3 | about: if an image displays wrong in your program, and you've verified stb_image is 4 | the problem 5 | title: '' 6 | labels: 1 stb_image 7 | assignees: '' 8 | 9 | --- 10 | 11 | 1. **Confirm that, after loading the image with stbi_load, you've immediately written it out with stbi_write_png or similar, and that version of the image is also wrong.** If it is correct when written out, the problem is not in stb_image. If it displays wrong in a program you're writing, it's probably your display code. For example, people writing OpenGL programs frequently do not upload or display the image correctly and assume stb_image is at fault even though writing out the image demonstrates that it loads correctly. 12 | 13 | 2. *Provide an image that does not load correctly using stb_image* so we can reproduce the problem. 14 | 15 | 3. *Provide an image or description of what part of the image is incorrect and how* so we can be sure we've reproduced the problem correctly. 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: if you're having trouble using a library, try the support forum instead 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3-feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 4 enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: support forum 4 | url: https://github.com/nothings/stb/discussions/categories/q-a 5 | about: having trouble using an stb library? don't create an issue, post in the forum 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | * Delete this list before clicking CREATE PULL REQUEST 2 | * Make sure you're using a special branch just for this pull request. (Sometimes people unknowingly use a default branch, then later update that branch, which updates the pull request with the other changes if it hasn't been merged yet.) 3 | * Do NOT update the version number in the file. (This just causes conflicts.) 4 | * Do add your name to the list of contributors. (Don't worry about the formatting.) I'll try to remember to add it if you don't, but I sometimes forget as it's an extra step. 5 | 6 | If you get something above wrong, don't fret it, it's not the end of the world. 7 | -------------------------------------------------------------------------------- /.github/workflows/ci-fuzz.yml: -------------------------------------------------------------------------------- 1 | name: CIFuzz 2 | on: [pull_request] 3 | jobs: 4 | Fuzzing: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Build Fuzzers 8 | uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master 9 | with: 10 | oss-fuzz-project-name: 'stb' 11 | dry-run: false 12 | - name: Run Fuzzers 13 | uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master 14 | with: 15 | oss-fuzz-project-name: 'stb' 16 | fuzz-seconds: 900 17 | dry-run: false 18 | - name: Upload Crash 19 | uses: actions/upload-artifact@v1 20 | if: failure() 21 | with: 22 | name: artifacts 23 | path: ./out/artifacts 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.obj 3 | *.exe 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: C 2 | arch: 3 | - AMD64 4 | - ppc64le 5 | install: true 6 | script: 7 | - cd tests 8 | - make all 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This software is available under 2 licenses -- choose whichever you prefer. 2 | ------------------------------------------------------------------------------ 3 | ALTERNATIVE A - MIT License 4 | Copyright (c) 2017 Sean Barrett 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | ------------------------------------------------------------------------------ 21 | ALTERNATIVE B - Public Domain (www.unlicense.org) 22 | This is free and unencumbered software released into the public domain. 23 | Anyone is free to copy, modify, publish, use, compile, sell, or distribute this 24 | software, either in source code form or as a compiled binary, for any purpose, 25 | commercial or non-commercial, and by any means. 26 | In jurisdictions that recognize copyright laws, the author or authors of this 27 | software dedicate any and all copyright interest in the software to the public 28 | domain. We make this dedication for the benefit of the public at large and to 29 | the detriment of our heirs and successors. We intend this dedication to be an 30 | overt act of relinquishment in perpetuity of all present and future rights to 31 | this software under copyright law. 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 36 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 37 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | This project discusses security-relevant bugs in public in Github Issues and Pull Requests, and it may take significant time for security fixes to be implemented or merged. If this poses an unreasonable risk to your project, do not use stb libraries. 3 | -------------------------------------------------------------------------------- /data/atari_8bit_font_revised.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/atari_8bit_font_revised.png -------------------------------------------------------------------------------- /data/easy_font_raw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/easy_font_raw.png -------------------------------------------------------------------------------- /data/herringbone/license.txt: -------------------------------------------------------------------------------- 1 | All files in this directory are in the public domain. Where 2 | a public domain declaration is not recognized, you are granted 3 | a license to freely use, modify, and redistribute them in 4 | any way you choose. -------------------------------------------------------------------------------- /data/herringbone/template_caves_limit_connectivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_caves_limit_connectivity.png -------------------------------------------------------------------------------- /data/herringbone/template_caves_tiny_corridors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_caves_tiny_corridors.png -------------------------------------------------------------------------------- /data/herringbone/template_corner_caves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_corner_caves.png -------------------------------------------------------------------------------- /data/herringbone/template_horizontal_corridors_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_horizontal_corridors_v1.png -------------------------------------------------------------------------------- /data/herringbone/template_horizontal_corridors_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_horizontal_corridors_v2.png -------------------------------------------------------------------------------- /data/herringbone/template_horizontal_corridors_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_horizontal_corridors_v3.png -------------------------------------------------------------------------------- /data/herringbone/template_limit_connectivity_fat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_limit_connectivity_fat.png -------------------------------------------------------------------------------- /data/herringbone/template_limited_connectivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_limited_connectivity.png -------------------------------------------------------------------------------- /data/herringbone/template_maze_2_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_maze_2_wide.png -------------------------------------------------------------------------------- /data/herringbone/template_maze_plus_2_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_maze_plus_2_wide.png -------------------------------------------------------------------------------- /data/herringbone/template_open_areas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_open_areas.png -------------------------------------------------------------------------------- /data/herringbone/template_ref2_corner_caves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_ref2_corner_caves.png -------------------------------------------------------------------------------- /data/herringbone/template_rooms_and_corridors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_rooms_and_corridors.png -------------------------------------------------------------------------------- /data/herringbone/template_rooms_and_corridors_2_wide_diagonal_bias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_rooms_and_corridors_2_wide_diagonal_bias.png -------------------------------------------------------------------------------- /data/herringbone/template_rooms_limit_connectivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_rooms_limit_connectivity.png -------------------------------------------------------------------------------- /data/herringbone/template_round_rooms_diagonal_corridors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_round_rooms_diagonal_corridors.png -------------------------------------------------------------------------------- /data/herringbone/template_sean_dungeon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_sean_dungeon.png -------------------------------------------------------------------------------- /data/herringbone/template_simple_caves_2_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_simple_caves_2_wide.png -------------------------------------------------------------------------------- /data/herringbone/template_square_rooms_with_random_rects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/herringbone/template_square_rooms_with_random_rects.png -------------------------------------------------------------------------------- /data/map_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/map_01.png -------------------------------------------------------------------------------- /data/map_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/map_02.png -------------------------------------------------------------------------------- /data/map_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/data/map_03.png -------------------------------------------------------------------------------- /deprecated/stretch_test.c: -------------------------------------------------------------------------------- 1 | // check that stb_truetype compiles with no stb_rect_pack.h 2 | #define STB_TRUETYPE_IMPLEMENTATION 3 | #include "stb_truetype.h" 4 | 5 | #define STB_DS_IMPLEMENTATION 6 | #include "stb_ds.h" 7 | #include 8 | 9 | int main(int arg, char **argv) 10 | { 11 | int i; 12 | int *arr = NULL; 13 | 14 | for (i=0; i < 1000000; ++i) 15 | arrput(arr, i); 16 | 17 | assert(arrlen(arr) == 1000000); 18 | for (i=0; i < 1000000; ++i) 19 | assert(arr[i] == i); 20 | 21 | arrfree(arr); 22 | arr = NULL; 23 | 24 | for (i=0; i < 1000; ++i) 25 | arrput(arr, 1000); 26 | assert(arrlen(arr) == 1000000); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /deprecated/stretchy_buffer.txt: -------------------------------------------------------------------------------- 1 | // stretchy buffer // init: NULL // free: sbfree() // push_back: sbpush() // size: sbcount() // 2 | #define sbfree(a) ((a) ? free(stb__sbraw(a)),0 : 0) 3 | #define sbpush(a,v) (stb__sbmaybegrow(a,1), (a)[stb__sbn(a)++] = (v)) 4 | #define sbcount(a) ((a) ? stb__sbn(a) : 0) 5 | #define sbadd(a,n) (stb__sbmaybegrow(a,n), stb__sbn(a)+=(n), &(a)[stb__sbn(a)-(n)]) 6 | #define sblast(a) ((a)[stb__sbn(a)-1]) 7 | 8 | #include 9 | #define stb__sbraw(a) ((int *) (a) - 2) 10 | #define stb__sbm(a) stb__sbraw(a)[0] 11 | #define stb__sbn(a) stb__sbraw(a)[1] 12 | 13 | #define stb__sbneedgrow(a,n) ((a)==0 || stb__sbn(a)+n >= stb__sbm(a)) 14 | #define stb__sbmaybegrow(a,n) (stb__sbneedgrow(a,(n)) ? stb__sbgrow(a,n) : 0) 15 | #define stb__sbgrow(a,n) stb__sbgrowf((void **) &(a), (n), sizeof(*(a))) 16 | 17 | static void stb__sbgrowf(void **arr, int increment, int itemsize) 18 | { 19 | int m = *arr ? 2*stb__sbm(*arr)+increment : increment+1; 20 | void *p = realloc(*arr ? stb__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2); 21 | assert(p); 22 | if (p) { 23 | if (!*arr) ((int *) p)[1] = 0; 24 | *arr = (void *) ((int *) p + 2); 25 | stb__sbm(*arr) = m; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /docs/other_libs.md: -------------------------------------------------------------------------------- 1 | Moved to https://github.com/nothings/single_file_libs -------------------------------------------------------------------------------- /stb_image_resize_test/oldir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef _MSC_VER 5 | #define stop() __debugbreak() 6 | #else 7 | #define stop() __builtin_trap() 8 | #endif 9 | 10 | //#define HEAVYTM 11 | #include "tm.h" 12 | 13 | #define STBIR_SATURATE_INT 14 | #define STB_IMAGE_RESIZE_STATIC 15 | #define STB_IMAGE_RESIZE_IMPLEMENTATION 16 | #include "old_image_resize.h" 17 | 18 | 19 | static int types[4] = { STBIR_TYPE_UINT8, STBIR_TYPE_UINT8, STBIR_TYPE_UINT16, STBIR_TYPE_FLOAT }; 20 | static int edges[4] = { STBIR_EDGE_CLAMP, STBIR_EDGE_REFLECT, STBIR_EDGE_ZERO, STBIR_EDGE_WRAP }; 21 | static int flts[5] = { STBIR_FILTER_BOX, STBIR_FILTER_TRIANGLE, STBIR_FILTER_CUBICBSPLINE, STBIR_FILTER_CATMULLROM, STBIR_FILTER_MITCHELL }; 22 | static int channels[20] = { 1, 2, 3, 4, 4,4, 2,2, 4,4, 2,2, 4,4, 2,2, 4,4, 2,2 }; 23 | static int alphapos[20] = { -1, -1, -1, -1, 3,0, 1,0, 3,0, 1,0, 3,0, 1,0, 3,0, 1,0 }; 24 | 25 | 26 | void oresize( void * o, int ox, int oy, int op, void * i, int ix, int iy, int ip, int buf, int type, int edg, int flt ) 27 | { 28 | int t = types[type]; 29 | int ic = channels[buf]; 30 | int alpha = alphapos[buf]; 31 | int e = edges[edg]; 32 | int f = flts[flt]; 33 | int space = ( type == 1 ) ? STBIR_COLORSPACE_SRGB : 0; 34 | int flags = ( buf >= 16 ) ? STBIR_FLAG_ALPHA_PREMULTIPLIED : ( ( buf >= 12 ) ? STBIR_FLAG_ALPHA_OUT_PREMULTIPLIED : ( ( buf >= 8 ) ? (STBIR_FLAG_ALPHA_PREMULTIPLIED|STBIR_FLAG_ALPHA_OUT_PREMULTIPLIED) : 0 ) ); 35 | stbir_uint64 start; 36 | 37 | ENTER( "Resize (old)" ); 38 | start = tmGetAccumulationStart( tm_mask ); 39 | 40 | if(!stbir_resize( i, ix, iy, ip, o, ox, oy, op, t, ic, alpha, flags, e, e, f, f, space, 0 ) ) 41 | stop(); 42 | 43 | #ifdef STBIR_PROFILE 44 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.setup, "Setup (old)" ); 45 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.filters, "Filters (old)" ); 46 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.looping, "Looping (old)" ); 47 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.vertical, "Vertical (old)" ); 48 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.horizontal, "Horizontal (old)" ); 49 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.decode, "Scanline input (old)" ); 50 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.encode, "Scanline output (old)" ); 51 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.alpha, "Alpha weighting (old)" ); 52 | tmEmitAccumulationZone( 0, 0, (tm_uint64 *)&start, 0, oldprofile.named.unalpha, "Alpha unweighting (old)" ); 53 | #endif 54 | 55 | LEAVE(); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES = -I.. 2 | CFLAGS = -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -DSTB_DIVIDE_TEST 3 | CPPFLAGS = -Wno-write-strings -DSTB_DIVIDE_TEST 4 | 5 | # Uncomment this line for reproducing OSS-Fuzz bugs with image_fuzzer 6 | #CFLAGS += -O -fsanitize=address 7 | 8 | all: 9 | $(CC) $(INCLUDES) $(CFLAGS) ../stb_vorbis.c test_c_compilation.c test_c_lexer.c test_dxt.c test_easyfont.c test_image.c test_image_write.c test_perlin.c test_sprintf.c test_truetype.c test_voxel.c -lm 10 | $(CC) $(INCLUDES) $(CPPFLAGS) -std=c++0x test_cpp_compilation.cpp -lm -lstdc++ 11 | $(CC) $(INCLUDES) $(CFLAGS) -DIWT_TEST image_write_test.c -lm -o image_write_test 12 | $(CC) $(INCLUDES) $(CFLAGS) fuzz_main.c stbi_read_fuzzer.c -lm -o image_fuzzer 13 | -------------------------------------------------------------------------------- /tests/c_lexer_test.c: -------------------------------------------------------------------------------- 1 | #define STB_C_LEX_C_DECIMAL_INTS Y // "0|[1-9][0-9]*" CLEX_intlit 2 | #define STB_C_LEX_C_HEX_INTS Y // "0x[0-9a-fA-F]+" CLEX_intlit 3 | #define STB_C_LEX_C_OCTAL_INTS Y // "[0-7]+" CLEX_intlit 4 | #define STB_C_LEX_C_DECIMAL_FLOATS Y // "[0-9]*(.[0-9]*([eE][-+]?[0-9]+)?) CLEX_floatlit 5 | #define STB_C_LEX_C99_HEX_FLOATS Y // "0x{hex}+(.{hex}*)?[pP][-+]?{hex}+ CLEX_floatlit 6 | #define STB_C_LEX_C_IDENTIFIERS Y // "[_a-zA-Z][_a-zA-Z0-9]*" CLEX_id 7 | #define STB_C_LEX_C_DQ_STRINGS Y // double-quote-delimited strings with escapes CLEX_dqstring 8 | #define STB_C_LEX_C_SQ_STRINGS Y // single-quote-delimited strings with escapes CLEX_ssstring 9 | #define STB_C_LEX_C_CHARS Y // single-quote-delimited character with escape CLEX_charlits 10 | #define STB_C_LEX_C_COMMENTS Y // "/* comment */" 11 | #define STB_C_LEX_CPP_COMMENTS Y // "// comment to end of line\n" 12 | #define STB_C_LEX_C_COMPARISONS Y // "==" CLEX_eq "!=" CLEX_noteq "<=" CLEX_lesseq ">=" CLEX_greatereq 13 | #define STB_C_LEX_C_LOGICAL Y // "&&" CLEX_andand "||" CLEX_oror 14 | #define STB_C_LEX_C_SHIFTS Y // "<<" CLEX_shl ">>" CLEX_shr 15 | #define STB_C_LEX_C_INCREMENTS Y // "++" CLEX_plusplus "--" CLEX_minusminus 16 | #define STB_C_LEX_C_ARROW Y // "->" CLEX_arrow 17 | #define STB_C_LEX_EQUAL_ARROW Y // "=>" CLEX_eqarrow 18 | #define STB_C_LEX_C_BITWISEEQ Y // "&=" CLEX_andeq "|=" CLEX_oreq "^=" CLEX_xoreq 19 | #define STB_C_LEX_C_ARITHEQ Y // "+=" CLEX_pluseq "-=" CLEX_minuseq 20 | // "*=" CLEX_muleq "/=" CLEX_diveq "%=" CLEX_modeq 21 | // if both STB_C_LEX_SHIFTS & STB_C_LEX_ARITHEQ: 22 | // "<<=" CLEX_shleq ">>=" CLEX_shreq 23 | 24 | #define STB_C_LEX_PARSE_SUFFIXES Y // letters after numbers are parsed as part of those numbers, and must be in suffix list below 25 | #define STB_C_LEX_DECIMAL_SUFFIXES "uUlL" // decimal integer suffixes e.g. "uUlL" -- these are returned as-is in string storage 26 | #define STB_C_LEX_HEX_SUFFIXES "lL" // e.g. "uUlL" 27 | #define STB_C_LEX_OCTAL_SUFFIXES "lL" // e.g. "uUlL" 28 | #define STB_C_LEX_FLOAT_SUFFIXES "uulL" // 29 | 30 | #define STB_C_LEX_0_IS_EOF N // if Y, ends parsing at '\0'; if N, returns '\0' as token 31 | #define STB_C_LEX_INTEGERS_AS_DOUBLES N // parses integers as doubles so they can be larger than 'int', but only if STB_C_LEX_STDLIB==N 32 | #define STB_C_LEX_MULTILINE_DSTRINGS Y // allow newlines in double-quoted strings 33 | #define STB_C_LEX_MULTILINE_SSTRINGS Y // allow newlines in single-quoted strings 34 | #define STB_C_LEX_USE_STDLIB N // use strtod,strtol for parsing #s; otherwise inaccurate hack 35 | #define STB_C_LEX_DOLLAR_IDENTIFIER Y // allow $ as an identifier character 36 | #define STB_C_LEX_FLOAT_NO_DECIMAL Y // allow floats that have no decimal point if they have an exponent 37 | 38 | #define STB_C_LEX_DEFINE_ALL_TOKEN_NAMES Y // if Y, all CLEX_ token names are defined, even if never returned 39 | // leaving it as N should help you catch config bugs 40 | 41 | #define STB_C_LEX_DISCARD_PREPROCESSOR Y // discard C-preprocessor directives (e.g. after prepocess 42 | // still have #line, #pragma, etc) 43 | 44 | #define STB_C_LEXER_DEFINITIONS // This line prevents the header file from replacing your definitions 45 | 46 | 47 | 48 | #define STB_C_LEXER_IMPLEMENTATION 49 | #define STB_C_LEXER_SELF_TEST 50 | #include "../stb_c_lexer.h" 51 | -------------------------------------------------------------------------------- /tests/c_lexer_test.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="c_lexer_test" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=c_lexer_test - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "c_lexer_test.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "c_lexer_test.mak" CFG="c_lexer_test - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "c_lexer_test - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "c_lexer_test - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "c_lexer_test - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "c_lexer_test - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug\c_lexer_test" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 68 | # SUBTRACT CPP /YX 69 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 70 | # ADD RSC /l 0x409 /d "_DEBUG" 71 | BSC32=bscmake.exe 72 | # ADD BASE BSC32 /nologo 73 | # ADD BSC32 /nologo 74 | LINK32=link.exe 75 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | 78 | !ENDIF 79 | 80 | # Begin Target 81 | 82 | # Name "c_lexer_test - Win32 Release" 83 | # Name "c_lexer_test - Win32 Debug" 84 | # Begin Source File 85 | 86 | SOURCE=.\c_lexer_test.c 87 | # End Source File 88 | # End Target 89 | # End Project 90 | -------------------------------------------------------------------------------- /tests/caveview/README.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | ### How to run it? 4 | 5 | There's no GUI. Find a directory with Minecraft Anvil files (.mca). 6 | Copy a Minecraft "terrain.png" into that directory (do a google 7 | image search). Run from that directory. 8 | 9 | ### How accurate is this as a Minecraft viewer? 10 | 11 | Not very. Many Minecraft blocks are not handled correctly: 12 | 13 | * No redstone, rails, or other "flat" blocks 14 | * No signs, doors, fences, carpets, or other complicated geometry 15 | * Stairs are turned into ramps 16 | * Upper slabs turn into lower slabs 17 | * Wood types only for blocks, not stairs, slabs, etc 18 | * Colored glass becomes regular glass 19 | * Glass panes become glass blocks 20 | * Water is opaque 21 | * Water level is incorrect 22 | * No biome coloration 23 | * Cactus is not shrunk, shows holes 24 | * Chests are not shrunk 25 | * Double-chests draw as two chests 26 | * Pumpkins etc. are not rotated properly 27 | * Torches are drawn hackily, do not attach to walls 28 | * Incorrect textures for blocks that postdate terrain.png 29 | * Transparent textures have black fringes due to non-premultiplied-alpha 30 | * Skylight and block light are combined in a single value 31 | * Only blocks at y=1..255 are shown (not y=0) 32 | * If a 32x32x256 "quad-chunk" needs more than 800K quads, isn't handled (very unlikely) 33 | 34 | Some of these are due to engine limitations, and some of 35 | these are because I didn't make the effort since my 36 | goal was to make a demo for stb_voxel_render.h, not 37 | to make a proper Minecraft viewer. 38 | 39 | 40 | ### Could this be turned into a proper Minecraft viewer? 41 | 42 | Yes and no. Yes, you could do it, but no, it wouldn't 43 | really resemble this code that much anymore. 44 | 45 | You could certainly use this engine to 46 | render the parts of Minecraft it works for, but many 47 | of the things it doesn't handle it can't handle at all 48 | (stairs, water, fences, carpets, etc) because it uses 49 | low-precision coordinates to store voxel data. 50 | 51 | You would have to render all of the stuff it doesn't 52 | handle through another rendering path. In a game (not 53 | a viewer) you would need such a path for movable entities 54 | like doors and carts anyway, so possibly handling other 55 | things that way wouldn't be so bad. 56 | 57 | Rails, ladders, and redstone lines could be implemented by 58 | using tex2 to overlay those effects, but you can't rotate 59 | tex1 and tex2 independently, so there may be cases where 60 | the underlying texture needs a different rotation from the 61 | overlaid texture, which would require separate rendering. 62 | Handling redstone's brightness being different from underlying 63 | block's brightness would require separate rendering. 64 | 65 | You can use the face-color effect to do biome coloration, 66 | but the change won't be smooth the way it is in Minecraft. 67 | 68 | 69 | ### Why isn't building the mesh data faster? 70 | 71 | Partly because converting from minecraft data is expensive. 72 | 73 | Here is the approximate breakdown of an older version 74 | of this executable and lib that did the building single-threaded. 75 | 76 | * 25% loading & parsing minecraft files (4/5ths of this is my crappy zlib) 77 | * 18% converting from minecraft blockids & lighting to stb blockids & lighting 78 | * 10% reordering from data[z][y]\[x] (minecraft-style) to data[y][x]\[z] (stb-style) 79 | * 40% building mesh data 80 | * 7% uploading mesh data to OpenGL 81 | 82 | I did do significant optimizations after the above, so the 83 | final breakdown is different, but it should give you some 84 | sense of the costs. 85 | 86 | -------------------------------------------------------------------------------- /tests/caveview/cave_parse.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_CAVE_PARSE_H 2 | #define INCLUDE_CAVE_PARSE_H 3 | 4 | typedef struct 5 | { 6 | unsigned char block; 7 | unsigned char data; 8 | unsigned char light:4; 9 | unsigned char skylight:4; 10 | } raw_block; 11 | 12 | // this is the old fully-decoded chunk 13 | typedef struct 14 | { 15 | int xpos, zpos, max_y; 16 | int height[16][16]; 17 | raw_block rb[16][16][256]; // [z][x][y] which becomes [y][x][z] in stb 18 | } chunk; 19 | 20 | chunk *get_decoded_chunk(int chunk_x, int chunk_z); 21 | 22 | #define NUM_SEGMENTS 16 23 | typedef struct 24 | { 25 | int max_y, xpos, zpos; 26 | 27 | unsigned char *blockdata[NUM_SEGMENTS]; 28 | unsigned char *data[NUM_SEGMENTS]; 29 | unsigned char *skylight[NUM_SEGMENTS]; 30 | unsigned char *light[NUM_SEGMENTS]; 31 | 32 | void *pointer_to_free; 33 | 34 | int refcount; // this allows multi-threaded building without wrapping in ANOTHER struct 35 | } fast_chunk; 36 | 37 | fast_chunk *get_decoded_fastchunk(int chunk_x, int chunk_z); // cache, never call free() 38 | 39 | fast_chunk *get_decoded_fastchunk_uncached(int chunk_x, int chunk_z); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /tests/caveview/caveview.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "caveview"=.\caveview.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /tests/caveview/caveview.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_CAVEVIEW_H 2 | #define INCLUDE_CAVEVIEW_H 3 | 4 | #include "stb.h" 5 | 6 | #include "stb_voxel_render.h" 7 | 8 | typedef struct 9 | { 10 | int cx,cy; 11 | 12 | stbvox_mesh_maker mm; 13 | 14 | uint8 *build_buffer; 15 | uint8 *face_buffer; 16 | 17 | int num_quads; 18 | float transform[3][3]; 19 | float bounds[2][3]; 20 | 21 | uint8 sv_blocktype[34][34][18]; 22 | uint8 sv_lighting [34][34][18]; 23 | } raw_mesh; 24 | 25 | // a 3D checkerboard of empty,solid would be: 32x32x255x6/2 ~= 800000 26 | // an all-leaf qchunk would be: 32 x 32 x 255 x 6 ~= 1,600,000 27 | 28 | #define BUILD_QUAD_MAX 400000 29 | #define BUILD_BUFFER_SIZE (4*4*BUILD_QUAD_MAX) // 4 bytes per vertex, 4 vertices per quad 30 | #define FACE_BUFFER_SIZE ( 4*BUILD_QUAD_MAX) // 4 bytes per quad 31 | 32 | 33 | extern void mesh_init(void); 34 | extern void render_init(void); 35 | extern void world_init(void); 36 | extern void ods(char *fmt, ...); // output debug string 37 | extern void reset_cache_size(int size); 38 | 39 | 40 | extern void render_caves(float pos[3]); 41 | 42 | 43 | #include "cave_parse.h" // fast_chunk 44 | 45 | extern fast_chunk *get_converted_fastchunk(int chunk_x, int chunk_y); 46 | extern void build_chunk(int chunk_x, int chunk_y, fast_chunk *fc_table[4][4], raw_mesh *rm); 47 | extern void reset_cache_size(int size); 48 | extern void deref_fastchunk(fast_chunk *fc); 49 | 50 | #endif -------------------------------------------------------------------------------- /tests/caveview/glext_list.h: -------------------------------------------------------------------------------- 1 | GLARB(ActiveTexture,ACTIVETEXTURE) 2 | GLARB(ClientActiveTexture,CLIENTACTIVETEXTURE) 3 | GLARB(MultiTexCoord2f,MULTITEXCOORD2F) 4 | GLEXT(TexImage3D,TEXIMAGE3D) 5 | GLEXT(TexSubImage3D,TEXSUBIMAGE3D) 6 | GLEXT(GenerateMipmap,GENERATEMIPMAP) 7 | GLARB(DebugMessageCallback,DEBUGMESSAGECALLBACK) 8 | 9 | GLCORE(VertexAttribIPointer,VERTEXATTRIBIPOINTER) 10 | 11 | GLEXT(BindFramebuffer,BINDFRAMEBUFFER) 12 | GLEXT(DeleteFramebuffers,DELETEFRAMEBUFFERS) 13 | GLEXT(GenFramebuffers,GENFRAMEBUFFERS) 14 | GLEXT(CheckFramebufferStatus,CHECKFRAMEBUFFERSTATUS) 15 | GLEXT(FramebufferTexture2D,FRAMEBUFFERTEXTURE2D) 16 | GLEXT(BindRenderBuffer,BINDRENDERBUFFER) 17 | GLEXT(RenderbufferStorage,RENDERBUFFERSTORAGE) 18 | GLEXT(GenRenderbuffers,GENRENDERBUFFERS) 19 | GLEXT(BindRenderbuffer,BINDRENDERBUFFER) 20 | GLEXT(FramebufferRenderbuffer,FRAMEBUFFERRENDERBUFFER) 21 | GLEXT(GenerateMipmap,GENERATEMIPMAP) 22 | 23 | GLARB(BindBuffer ,BINDBUFFER,) 24 | GLARB(GenBuffers ,GENBUFFERS ) 25 | GLARB(DeleteBuffers,DELETEBUFFERS) 26 | GLARB(BufferData ,BUFFERDATA ) 27 | GLARB(BufferSubData,BUFFERSUBDATA) 28 | GLARB(MapBuffer ,MAPBUFFER ) 29 | GLARB(UnmapBuffer ,UNMAPBUFFER ) 30 | GLARB(TexBuffer ,TEXBUFFER ) 31 | 32 | GLEXT(NamedBufferStorage,NAMEDBUFFERSTORAGE) 33 | GLE(BufferStorage,BUFFERSTORAGE) 34 | GLE(GetStringi,GETSTRINGI) -------------------------------------------------------------------------------- /tests/caveview/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/caveview/main.c -------------------------------------------------------------------------------- /tests/fuzz_main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* fuzz target entry point, works without libFuzzer */ 6 | 7 | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); 8 | 9 | int main(int argc, char **argv) 10 | { 11 | FILE *f; 12 | char *buf = NULL; 13 | long siz_buf; 14 | 15 | if(argc < 2) 16 | { 17 | fprintf(stderr, "no input file\n"); 18 | goto err; 19 | } 20 | 21 | f = fopen(argv[1], "rb"); 22 | if(f == NULL) 23 | { 24 | fprintf(stderr, "error opening input file %s\n", argv[1]); 25 | goto err; 26 | } 27 | 28 | fseek(f, 0, SEEK_END); 29 | 30 | siz_buf = ftell(f); 31 | rewind(f); 32 | 33 | if(siz_buf < 1) goto err; 34 | 35 | buf = (char*)malloc((size_t)siz_buf); 36 | if(buf == NULL) 37 | { 38 | fprintf(stderr, "malloc() failed\n"); 39 | goto err; 40 | } 41 | 42 | if(fread(buf, (size_t)siz_buf, 1, f) != 1) 43 | { 44 | fprintf(stderr, "fread() failed\n"); 45 | goto err; 46 | } 47 | 48 | (void)LLVMFuzzerTestOneInput((uint8_t*)buf, (size_t)siz_buf); 49 | 50 | err: 51 | free(buf); 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /tests/herringbone.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="herringbone" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=herringbone - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "herringbone.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "herringbone.mak" CFG="herringbone - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "herringbone - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "herringbone - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "herringbone - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "herringbone - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "herringbone___Win32_Debug" 60 | # PROP BASE Intermediate_Dir "herringbone___Win32_Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Ignore_Export_Lib 0 67 | # PROP Target_Dir "" 68 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 69 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 70 | # SUBTRACT CPP /YX 71 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 72 | # ADD RSC /l 0x409 /d "_DEBUG" 73 | BSC32=bscmake.exe 74 | # ADD BASE BSC32 /nologo 75 | # ADD BSC32 /nologo 76 | LINK32=link.exe 77 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 79 | 80 | !ENDIF 81 | 82 | # Begin Target 83 | 84 | # Name "herringbone - Win32 Release" 85 | # Name "herringbone - Win32 Debug" 86 | # Begin Source File 87 | 88 | SOURCE=.\herringbone_generator.c 89 | # End Source File 90 | # Begin Source File 91 | 92 | SOURCE=..\stb_herringbone_wang_tile.h 93 | # End Source File 94 | # End Target 95 | # End Project 96 | -------------------------------------------------------------------------------- /tests/herringbone_generator.c: -------------------------------------------------------------------------------- 1 | #define STB_HERRINGBONE_WANG_TILE_IMPLEMENTATION 2 | #include "stb_herringbone_wang_tile.h" 3 | 4 | #define STB_IMAGE_WRITE_IMPLEMENTATION 5 | #include "stb_image_write.h" 6 | 7 | // e 12 1 1 1 1 1 1 4 4 8 | 9 | int main(int argc, char **argv) 10 | { 11 | stbhw_config c = { 0 }; 12 | int w,h, num_colors,i; 13 | unsigned char *data; 14 | 15 | if (argc == 1) goto usage; 16 | if (argc < 3) goto error; 17 | 18 | switch (argv[2][0]) { 19 | case 'c': 20 | if (argc < 8 || argc > 10) 21 | goto error; 22 | num_colors = 4; 23 | c.is_corner = 1; 24 | break; 25 | 26 | case 'e': 27 | if (argc < 10 || argc > 12) 28 | goto error; 29 | num_colors = 6; 30 | c.is_corner = 0; 31 | break; 32 | 33 | default: 34 | goto error; 35 | } 36 | 37 | c.short_side_len = atoi(argv[3]); 38 | for (i=0; i < num_colors; ++i) 39 | c.num_color[i] = atoi(argv[4+i]); 40 | 41 | c.num_vary_x = 1; 42 | c.num_vary_y = 1; 43 | 44 | if (argc > 4+i) 45 | c.num_vary_x = atoi(argv[4+i]); 46 | if (argc > 5+i) 47 | c.num_vary_y = atoi(argv[5+i]); 48 | 49 | stbhw_get_template_size(&c, &w, &h); 50 | 51 | data = (unsigned char *) malloc(w*h*3); 52 | 53 | if (stbhw_make_template(&c, data, w, h, w*3)) 54 | stbi_write_png(argv[1], w, h, 3, data, w*3); 55 | else 56 | fprintf(stderr, "Error: %s\n", stbhw_get_last_error()); 57 | return 0; 58 | 59 | error: 60 | fputs("Invalid command-line arguments\n\n", stderr); 61 | usage: 62 | fputs("Usage (see source for corner & edge type definitions):\n\n", stderr); 63 | fputs("herringbone_generator {outfile} c {sidelen} {c0} {c1} {c2} {c3} [{vx} {vy}]\n" 64 | " {outfile} -- filename that template will be written to as PNG\n" 65 | " {sidelen} -- length of short side of rectangle in pixels\n" 66 | " {c0} -- number of colors for corner type 0\n" 67 | " {c1} -- number of colors for corner type 1\n" 68 | " {c2} -- number of colors for corner type 2\n" 69 | " {c3} -- number of colors for corner type 3\n" 70 | " {vx} -- number of color-duplicating variations horizontally in template\n" 71 | " {vy} -- number of color-duplicating variations vertically in template\n" 72 | "\n" 73 | , stderr); 74 | fputs("herringbone_generator {outfile} e {sidelen} {e0} {e1} {e2} {e3} {e4} {e5} [{vx} {vy}]\n" 75 | " {outfile} -- filename that template will be written to as PNG\n" 76 | " {sidelen} -- length of short side of rectangle in pixels\n" 77 | " {e0} -- number of colors for edge type 0\n" 78 | " {e1} -- number of colors for edge type 1\n" 79 | " {e2} -- number of colors for edge type 2\n" 80 | " {e3} -- number of colors for edge type 3\n" 81 | " {e4} -- number of colors for edge type 4\n" 82 | " {e5} -- number of colors for edge type 5\n" 83 | " {vx} -- number of color-duplicating variations horizontally in template\n" 84 | " {vy} -- number of color-duplicating variations vertically in template\n" 85 | , stderr); 86 | return 1; 87 | } 88 | -------------------------------------------------------------------------------- /tests/herringbone_map.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STB_HBWANG_MAX_X 500 4 | #define STB_HBWANG_MAX_Y 500 5 | 6 | #define STB_HERRINGBONE_WANG_TILE_IMPLEMENTATION 7 | #include "stb_herringbone_wang_tile.h" 8 | 9 | #define STB_IMAGE_IMPLEMENTATION 10 | #include "stb_image.h" 11 | 12 | #define STB_IMAGE_WRITE_IMPLEMENTATION 13 | #include "stb_image_write.h" 14 | 15 | int main(int argc, char **argv) 16 | { 17 | if (argc < 5) { 18 | fprintf(stderr, "Usage: herringbone_map {inputfile} {output-width} {output-height} {outputfile}\n"); 19 | return 1; 20 | } else { 21 | char *filename = argv[1]; 22 | int out_w = atoi(argv[2]); 23 | int out_h = atoi(argv[3]); 24 | char *outfile = argv[4]; 25 | 26 | unsigned char *pixels, *out_pixels; 27 | stbhw_tileset ts; 28 | int w,h; 29 | 30 | pixels = stbi_load(filename, &w, &h, 0, 3); 31 | if (pixels == 0) { 32 | fprintf(stderr, "Couldn't open input file '%s'\n", filename); 33 | exit(1); 34 | } 35 | 36 | if (!stbhw_build_tileset_from_image(&ts, pixels, w*3, w, h)) { 37 | fprintf(stderr, "Error: %s\n", stbhw_get_last_error()); 38 | return 1; 39 | } 40 | 41 | free(pixels); 42 | 43 | #ifdef DEBUG_OUTPUT 44 | { 45 | int i,j,k; 46 | // add blue borders to top-left edges of the tiles 47 | int hstride = (ts.short_side_len*2)*3; 48 | int vstride = (ts.short_side_len )*3; 49 | for (i=0; i < ts.num_h_tiles; ++i) { 50 | unsigned char *pix = ts.h_tiles[i]->pixels; 51 | for (j=0; j < ts.short_side_len*2; ++j) 52 | for (k=0; k < 3; ++k) 53 | pix[j*3+k] = (pix[j*3+k]*0.5+100+k*75)/1.5; 54 | for (j=1; j < ts.short_side_len; ++j) 55 | for (k=0; k < 3; ++k) 56 | pix[j*hstride+k] = (pix[j*hstride+k]*0.5+100+k*75)/1.5; 57 | } 58 | for (i=0; i < ts.num_v_tiles; ++i) { 59 | unsigned char *pix = ts.v_tiles[i]->pixels; 60 | for (j=0; j < ts.short_side_len; ++j) 61 | for (k=0; k < 3; ++k) 62 | pix[j*3+k] = (pix[j*3+k]*0.5+100+k*75)/1.5; 63 | for (j=1; j < ts.short_side_len*2; ++j) 64 | for (k=0; k < 3; ++k) 65 | pix[j*vstride+k] = (pix[j*vstride+k]*0.5+100+k*75)/1.5; 66 | } 67 | } 68 | #endif 69 | 70 | out_pixels = malloc(out_w * out_h * 3); 71 | 72 | if (!stbhw_generate_image(&ts, NULL, out_pixels, out_w*3, out_w, out_h)) { 73 | fprintf(stderr, "Error: %s\n", stbhw_get_last_error()); 74 | return 1; 75 | } 76 | 77 | stbi_write_png(argv[4], out_w, out_h, 3, out_pixels, out_w*3); 78 | free(out_pixels); 79 | 80 | stbhw_free_tileset(&ts); 81 | return 0; 82 | } 83 | } -------------------------------------------------------------------------------- /tests/herringbone_map.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="herringbone_map" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=herringbone_map - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "herringbone_map.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "herringbone_map.mak" CFG="herringbone_map - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "herringbone_map - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "herringbone_map - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "herringbone_map - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "herringbone_map - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "herringbone_map___Win32_Debug" 60 | # PROP BASE Intermediate_Dir "herringbone_map___Win32_Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "herringbone_map - Win32 Release" 84 | # Name "herringbone_map - Win32 Debug" 85 | # Begin Source File 86 | 87 | SOURCE=.\herringbone_map.c 88 | # End Source File 89 | # Begin Source File 90 | 91 | SOURCE=..\stb_herringbone_wang_tile.h 92 | # End Source File 93 | # End Target 94 | # End Project 95 | -------------------------------------------------------------------------------- /tests/image_test.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="image_test" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=image_test - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "image_test.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "image_test.mak" CFG="image_test - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "image_test - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "image_test - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "image_test - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /W3 /GX /Zi /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c 46 | # SUBTRACT CPP /YX 47 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 48 | # ADD RSC /l 0x409 /d "NDEBUG" 49 | BSC32=bscmake.exe 50 | # ADD BASE BSC32 /nologo 51 | # ADD BSC32 /nologo 52 | LINK32=link.exe 53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 55 | 56 | !ELSEIF "$(CFG)" == "image_test - Win32 Debug" 57 | 58 | # PROP BASE Use_MFC 0 59 | # PROP BASE Use_Debug_Libraries 1 60 | # PROP BASE Output_Dir "Debug" 61 | # PROP BASE Intermediate_Dir "Debug" 62 | # PROP BASE Target_Dir "" 63 | # PROP Use_MFC 0 64 | # PROP Use_Debug_Libraries 1 65 | # PROP Output_Dir "Debug" 66 | # PROP Intermediate_Dir "Debug\image_test" 67 | # PROP Target_Dir "" 68 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 69 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 70 | # SUBTRACT CPP /YX 71 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 72 | # ADD RSC /l 0x409 /d "_DEBUG" 73 | BSC32=bscmake.exe 74 | # ADD BASE BSC32 /nologo 75 | # ADD BSC32 /nologo 76 | LINK32=link.exe 77 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 79 | 80 | !ENDIF 81 | 82 | # Begin Target 83 | 84 | # Name "image_test - Win32 Release" 85 | # Name "image_test - Win32 Debug" 86 | # Begin Source File 87 | 88 | SOURCE=.\image_test.c 89 | # End Source File 90 | # Begin Source File 91 | 92 | SOURCE=.\image_write_test.c 93 | # End Source File 94 | # Begin Source File 95 | 96 | SOURCE=..\stb_image.h 97 | # End Source File 98 | # Begin Source File 99 | 100 | SOURCE=..\stb_image_write.h 101 | # End Source File 102 | # End Target 103 | # End Project 104 | -------------------------------------------------------------------------------- /tests/image_write_test.c: -------------------------------------------------------------------------------- 1 | #ifdef __clang__ 2 | #define STBIWDEF static inline 3 | #endif 4 | #define STB_IMAGE_WRITE_STATIC 5 | #define STB_IMAGE_WRITE_IMPLEMENTATION 6 | #include "stb_image_write.h" 7 | 8 | // using an 'F' since it has no rotational symmetries, and 6x5 9 | // because it's a small, atypical size likely to trigger edge cases. 10 | // 11 | // conveniently, it's also small enough to fully fit inside a typical 12 | // directory listing thumbnail, which simplifies checking at a glance. 13 | static const char img6x5_template[] = 14 | ".****." 15 | ".*...." 16 | ".***.." 17 | ".*...." 18 | ".*...."; 19 | 20 | void image_write_test(void) 21 | { 22 | // make a RGB version of the template image 23 | // use red on blue to detect R<->B swaps 24 | unsigned char img6x5_rgb[6*5*3]; 25 | float img6x5_rgbf[6*5*3]; 26 | int i; 27 | 28 | for (i = 0; i < 6*5; i++) { 29 | int on = img6x5_template[i] == '*'; 30 | img6x5_rgb[i*3 + 0] = on ? 255 : 0; 31 | img6x5_rgb[i*3 + 1] = 0; 32 | img6x5_rgb[i*3 + 2] = on ? 0 : 255; 33 | 34 | img6x5_rgbf[i*3 + 0] = on ? 1.0f : 0.0f; 35 | img6x5_rgbf[i*3 + 1] = 0.0f; 36 | img6x5_rgbf[i*3 + 2] = on ? 0.0f : 1.0f; 37 | } 38 | 39 | stbi_write_png("output/wr6x5_regular.png", 6, 5, 3, img6x5_rgb, 6*3); 40 | stbi_write_bmp("output/wr6x5_regular.bmp", 6, 5, 3, img6x5_rgb); 41 | stbi_write_tga("output/wr6x5_regular.tga", 6, 5, 3, img6x5_rgb); 42 | stbi_write_jpg("output/wr6x5_regular.jpg", 6, 5, 3, img6x5_rgb, 95); 43 | stbi_write_hdr("output/wr6x5_regular.hdr", 6, 5, 3, img6x5_rgbf); 44 | 45 | stbi_flip_vertically_on_write(1); 46 | 47 | stbi_write_png("output/wr6x5_flip.png", 6, 5, 3, img6x5_rgb, 6*3); 48 | stbi_write_bmp("output/wr6x5_flip.bmp", 6, 5, 3, img6x5_rgb); 49 | stbi_write_tga("output/wr6x5_flip.tga", 6, 5, 3, img6x5_rgb); 50 | stbi_write_jpg("output/wr6x5_flip.jpg", 6, 5, 3, img6x5_rgb, 95); 51 | stbi_write_hdr("output/wr6x5_flip.hdr", 6, 5, 3, img6x5_rgbf); 52 | } 53 | 54 | #ifdef IWT_TEST 55 | int main(int argc, char **argv) 56 | { 57 | image_write_test(); 58 | return 0; 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /tests/ossfuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | # This script is meant to be run by 3 | # https://github.com/google/oss-fuzz/blob/master/projects/stb/Dockerfile 4 | 5 | $CXX $CXXFLAGS -std=c++11 -I. -DSTBI_ONLY_PNG \ 6 | $SRC/stb/tests/stbi_read_fuzzer.c \ 7 | -o $OUT/stb_png_read_fuzzer $LIB_FUZZING_ENGINE 8 | 9 | $CXX $CXXFLAGS -std=c++11 -I. \ 10 | $SRC/stb/tests/stbi_read_fuzzer.c \ 11 | -o $OUT/stbi_read_fuzzer $LIB_FUZZING_ENGINE 12 | 13 | find $SRC/stb/tests/pngsuite -name "*.png" | \ 14 | xargs zip $OUT/stb_png_read_fuzzer_seed_corpus.zip 15 | 16 | cp $SRC/stb/tests/stb_png.dict $OUT/stb_png_read_fuzzer.dict 17 | 18 | tar xvzf $SRC/stbi/jpg.tar.gz --directory $SRC/stb/tests 19 | tar xvzf $SRC/stbi/gif.tar.gz --directory $SRC/stb/tests 20 | unzip $SRC/stbi/bmp.zip -d $SRC/stb/tests 21 | unzip $SRC/stbi/tga.zip -d $SRC/stb/tests 22 | 23 | find $SRC/stb/tests -name "*.png" -o -name "*.jpg" -o -name "*.gif" \ 24 | -o -name "*.bmp" -o -name "*.tga" -o -name "*.TGA" \ 25 | -o -name "*.ppm" -o -name "*.pgm" \ 26 | | xargs zip $OUT/stbi_read_fuzzer_seed_corpus.zip 27 | 28 | echo "" >> $SRC/stbi/gif.dict 29 | cat $SRC/stbi/gif.dict $SRC/stb/tests/stb_png.dict > $OUT/stbi_read_fuzzer.dict 30 | -------------------------------------------------------------------------------- /tests/oversample/oversample.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="oversample" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Application" 0x0101 6 | 7 | CFG=oversample - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "oversample.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "oversample.mak" CFG="oversample - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "oversample - Win32 Release" (based on "Win32 (x86) Application") 21 | !MESSAGE "oversample - Win32 Debug" (based on "Win32 (x86) Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | MTL=midl.exe 30 | RSC=rc.exe 31 | 32 | !IF "$(CFG)" == "oversample - Win32 Release" 33 | 34 | # PROP BASE Use_MFC 0 35 | # PROP BASE Use_Debug_Libraries 0 36 | # PROP BASE Output_Dir "Release" 37 | # PROP BASE Intermediate_Dir "Release" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_MFC 0 40 | # PROP Use_Debug_Libraries 0 41 | # PROP Output_Dir "Release" 42 | # PROP Intermediate_Dir "Release" 43 | # PROP Ignore_Export_Lib 0 44 | # PROP Target_Dir "" 45 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c 46 | # ADD CPP /nologo /W3 /WX /GX /O2 /I "c:\sean\prj\stb" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c 47 | # SUBTRACT CPP /YX 48 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 49 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 50 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 51 | # ADD RSC /l 0x409 /d "NDEBUG" 52 | BSC32=bscmake.exe 53 | # ADD BASE BSC32 /nologo 54 | # ADD BSC32 /nologo 55 | LINK32=link.exe 56 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 57 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 58 | # SUBTRACT LINK32 /map /debug 59 | 60 | !ELSEIF "$(CFG)" == "oversample - Win32 Debug" 61 | 62 | # PROP BASE Use_MFC 0 63 | # PROP BASE Use_Debug_Libraries 1 64 | # PROP BASE Output_Dir "Debug" 65 | # PROP BASE Intermediate_Dir "Debug" 66 | # PROP BASE Target_Dir "" 67 | # PROP Use_MFC 0 68 | # PROP Use_Debug_Libraries 1 69 | # PROP Output_Dir "Debug" 70 | # PROP Intermediate_Dir "Debug" 71 | # PROP Ignore_Export_Lib 0 72 | # PROP Target_Dir "" 73 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c 74 | # ADD CPP /nologo /W3 /WX /Gm /GX /Zi /Od /I "c:\sean\prj\stb" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c 75 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 76 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 77 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 78 | # ADD RSC /l 0x409 /d "_DEBUG" 79 | BSC32=bscmake.exe 80 | # ADD BASE BSC32 /nologo 81 | # ADD BSC32 /nologo 82 | LINK32=link.exe 83 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept 84 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /pdbtype:sept 85 | 86 | !ENDIF 87 | 88 | # Begin Target 89 | 90 | # Name "oversample - Win32 Release" 91 | # Name "oversample - Win32 Debug" 92 | # Begin Source File 93 | 94 | SOURCE=.\main.c 95 | # End Source File 96 | # End Target 97 | # End Project 98 | -------------------------------------------------------------------------------- /tests/oversample/oversample.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "oversample"=.\oversample.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /tests/oversample/oversample.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/oversample/oversample.exe -------------------------------------------------------------------------------- /tests/pbm/basi0g16.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/basi0g16.pgm -------------------------------------------------------------------------------- /tests/pbm/basi2c16.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/basi2c16.ppm -------------------------------------------------------------------------------- /tests/pbm/cdfn2c08.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/cdfn2c08.ppm -------------------------------------------------------------------------------- /tests/pbm/cdun2c08.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/cdun2c08.ppm -------------------------------------------------------------------------------- /tests/pbm/comment.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/comment.pgm -------------------------------------------------------------------------------- /tests/pbm/ctfn0g04.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pbm/ctfn0g04.pgm -------------------------------------------------------------------------------- /tests/pg_test/pg_test.c: -------------------------------------------------------------------------------- 1 | #define STB_DEFINE 2 | #include "stb.h" 3 | #define STB_PG_IMPLEMENTATION 4 | #include "stb_pg.h" 5 | #define STB_IMAGE_IMPLEMENTATION 6 | #include "stb_image.h" 7 | #define STB_IMAGE_WRITE_IMPLEMENTATION 8 | #include "stb_image_write.h" 9 | 10 | static float *hf; 11 | static int hf_width = 10001; 12 | static int hf_height = 10001; 13 | 14 | static float get_height(float x, float y) 15 | { 16 | float h00,h01,h10,h11,h0,h1; 17 | int ix,iy; 18 | if (x < 0) x = 0; 19 | if (x > hf_width-1) x = (float) hf_width-1; 20 | if (y < 0) y = 0; 21 | if (y > hf_height-1) y = (float) hf_height-1; 22 | ix = (int) x; x -= ix; 23 | iy = (int) y; y -= iy; 24 | h00 = hf[(iy+0)*hf_height+(ix+0)]; 25 | h10 = hf[(iy+0)*hf_height+(ix+1)]; 26 | h01 = hf[(iy+1)*hf_height+(ix+0)]; 27 | h11 = hf[(iy+1)*hf_height+(ix+1)]; 28 | h0 = stb_lerp(y, h00, h01); 29 | h1 = stb_lerp(y, h10, h11); 30 | return stb_lerp(x, h0, h1); 31 | } 32 | 33 | void stbpg_tick(float dt) 34 | { 35 | int i=0,j=0; 36 | int step = 1; 37 | 38 | glUseProgram(0); 39 | 40 | glClearColor(0.6f,0.7f,1.0f,1.0f); 41 | glClearDepth(1.0f); 42 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 43 | 44 | glDepthFunc(GL_LESS); 45 | glEnable(GL_DEPTH_TEST); 46 | #if 1 47 | glEnable(GL_CULL_FACE); 48 | 49 | glMatrixMode(GL_PROJECTION); 50 | glLoadIdentity(); 51 | gluPerspective(60.0, 1920/1080.0f, 0.02f, 8000.0f); 52 | //glOrtho(-8,8,-6,6, -100, 100); 53 | 54 | glMatrixMode(GL_MODELVIEW); 55 | glLoadIdentity(); 56 | glRotatef(-90, 1,0,0); // z-up 57 | 58 | { 59 | float x,y; 60 | stbpg_get_mouselook(&x,&y); 61 | glRotatef(-y, 1,0,0); 62 | glRotatef(-x, 0,0,1); 63 | } 64 | 65 | { 66 | static float cam_x = 1000; 67 | static float cam_y = 1000; 68 | static float cam_z = 700; 69 | float x=0,y=0; 70 | stbpg_get_keymove(&x,&y); 71 | cam_x += x*dt*5.0f; 72 | cam_y += y*dt*5.0f; 73 | glTranslatef(-cam_x, -cam_y, -cam_z); 74 | if (cam_x >= 0 && cam_x < hf_width && cam_y >= 0 && cam_y < hf_height) 75 | cam_z = get_height(cam_x, cam_y) + 1.65f; // average eye height in meters 76 | } 77 | 78 | for (j=501; j+1 < 1500+0*hf_height; j += step) { 79 | glBegin(GL_QUAD_STRIP); 80 | for (i=501; i < 1500+0*hf_width; i += step) { 81 | static int flip=0; 82 | if (flip) 83 | glColor3f(0.5,0.5,0.5); 84 | else 85 | glColor3f(0.4f,0.4f,0.4f); 86 | flip = !flip; 87 | glVertex3f((float) i, (float) j+step,hf[(j+step)*hf_width+i]); 88 | glVertex3f((float) i, (float) j ,hf[ j *hf_width+i]); 89 | } 90 | glEnd(); 91 | } 92 | 93 | glBegin(GL_LINES); 94 | glColor3f(1,0,0); glVertex3f(10,0,0); glVertex3f(0,0,0); 95 | glColor3f(0,1,0); glVertex3f(0,10,0); glVertex3f(0,0,0); 96 | glColor3f(0,0,1); glVertex3f(0,0,10); glVertex3f(0,0,0); 97 | glEnd(); 98 | #endif 99 | } 100 | 101 | void stbpg_main(int argc, char **argv) 102 | { 103 | int i,j; 104 | 105 | #if 0 106 | int w,h,c; 107 | unsigned short *data = stbi_load_16("c:/x/ned_1m/test2.png", &w, &h, &c, 1); 108 | stb_filewrite("c:/x/ned_1m/x73_y428_10012_10012.bin", data, w*h*2); 109 | #else 110 | unsigned short *data = stb_file("c:/x/ned_1m/x73_y428_10012_10012.bin", NULL); 111 | int w=10012, h = 10012; 112 | #endif 113 | 114 | hf = malloc(hf_width * hf_height * 4); 115 | for (j=0; j < hf_height; ++j) 116 | for (i=0; i < hf_width; ++i) 117 | hf[j*hf_width+i] = data[j*w+i] / 32.0f; 118 | 119 | stbpg_gl_compat_version(1,1); 120 | stbpg_windowed("terrain_edit", 1920, 1080); 121 | stbpg_run(); 122 | 123 | return; 124 | } 125 | -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basi0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basi0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basi2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basi2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basi4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basi4a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basi6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basi6a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basn0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basn2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basn4a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/basn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/basn6a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/bgai4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/bgai4a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/bgan6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/bgan6a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/bggn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/bggn4a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/bgyn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/bgyn6a16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi1n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi1n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi1n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi2n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi2n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi2n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi4n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi4n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi4n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi4n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi9n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi9n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/oi9n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/oi9n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/tbbn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/tbbn2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/tbgn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/tbgn2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/16bit/tbwn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/16bit/tbwn0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/PngSuite.LICENSE: -------------------------------------------------------------------------------- 1 | PngSuite 2 | -------- 3 | 4 | Permission to use, copy, modify and distribute these images for any 5 | purpose and without fee is hereby granted. 6 | 7 | 8 | (c) Willem van Schaik, 1996, 2011 9 | 10 | -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xc1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xc1n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xc9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xc9n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xcrn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xcrn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xcsn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xcsn0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xd0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xd0n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xd3n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xd3n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xd9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xd9n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xdtn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xdtn0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xhdn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xhdn0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xlfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xlfn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xs1n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xs1n0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xs2n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xs2n0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xs4n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xs4n0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/corrupt/xs7n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/corrupt/xs7n0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_basi0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_basi0g02.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_basi3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_bgwn6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_bgyn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_bgyn6a16.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_tbyn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/iphone/iphone_z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/iphone/iphone_z06n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi0g02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basi6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn0g02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/basn6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/bgai4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/bgan6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/bgbn4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/bgwn6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s01i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s01n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s02i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s02n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s03i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s03n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s04i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s04n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s05i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s05n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s06i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s06n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s07i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s07n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s08i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s08n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s09i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s09n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s32i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s32n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s33i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s33n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s34i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s34n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s35i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s35n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s36i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s36n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s37i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s37n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s38i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s38n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s39i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s39n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s40i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/s40n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbbn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbbn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbgn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbrn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbwn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tbyn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tm3n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tp0n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tp0n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tp0n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/tp1n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/z00n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/z03n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/z06n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary/z09n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi0g02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basi6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn0g01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn0g02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/basn6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/bgai4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/bgan6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/bgbn4a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/bgwn6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s01i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s01n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s02i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s02n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s03i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s03n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s04i3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s04n3p01.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s05i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s05n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s06i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s06n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s07i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s07n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s08i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s08n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s09i3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s09n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s32i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s32n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s33i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s33n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s34i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s34n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s35i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s35n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s36i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s36n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s37i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s37n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s38i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s38n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s39i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s39n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s40i3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/s40n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbbn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbbn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbgn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbrn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbwn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tbyn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tm3n3p02.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tp0n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tp0n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tp0n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/tp1n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/z00n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/z03n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/z06n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/primary_check/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/primary_check/z09n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ccwn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ccwn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ccwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ccwn3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cdfn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cdfn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cdhn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cdhn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cdsn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cdsn2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cdun2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cdun2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ch1n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ch1n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ch2n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ch2n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cm0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cm0n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cm7n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cm7n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cm9n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cm9n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs3n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs3n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs3n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs3n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs5n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs5n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs5n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs5n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs8n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs8n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cs8n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cs8n3p08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ct0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ct0n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ct1n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ct1n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cten0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cten0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ctfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ctfn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ctgn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ctgn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/cthn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/cthn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ctjn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ctjn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ctzn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ctzn0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f00n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f00n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f00n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f01n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f01n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f01n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f01n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f02n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f02n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f02n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f02n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f03n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f03n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f03n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f04n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f04n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f04n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/f99n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/f99n0g04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g03n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g03n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g03n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g03n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g03n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g04n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g04n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g04n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g04n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g04n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g05n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g05n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g05n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g05n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g05n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g05n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g07n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g07n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g07n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g07n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g07n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g07n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g10n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g10n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g10n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g10n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g10n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g10n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g25n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g25n0g16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g25n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g25n2c08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/g25n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/g25n3p04.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/pp0n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/pp0n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/pp0n6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/pp0n6a08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ps1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ps1n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ps1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ps1n2c16.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ps2n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ps2n0g08.png -------------------------------------------------------------------------------- /tests/pngsuite/unused/ps2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/pngsuite/unused/ps2n2c16.png -------------------------------------------------------------------------------- /tests/resample_test_c.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_RESIZE_IMPLEMENTATION 2 | #define STB_IMAGE_RESIZE_STATIC 3 | #include "stb_image_resize.h" 4 | 5 | // Just to make sure it will build properly with a c compiler 6 | 7 | int main() { 8 | } 9 | -------------------------------------------------------------------------------- /tests/resize.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="resize" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=resize - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "resize.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "resize.mak" CFG="resize - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "resize - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "resize - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "resize - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /G6 /W3 /GX /Z7 /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "resize - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "Debug" 60 | # PROP BASE Intermediate_Dir "Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD CPP /nologo /W3 /WX /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "resize - Win32 Release" 84 | # Name "resize - Win32 Debug" 85 | # Begin Source File 86 | 87 | SOURCE=.\resample_test.cpp 88 | # End Source File 89 | # Begin Source File 90 | 91 | SOURCE=..\stb_image_resize2.h 92 | # End Source File 93 | # End Target 94 | # End Project 95 | -------------------------------------------------------------------------------- /tests/sdf/sdf_test_arial_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/sdf/sdf_test_arial_16.png -------------------------------------------------------------------------------- /tests/sdf/sdf_test_times_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/sdf/sdf_test_times_16.png -------------------------------------------------------------------------------- /tests/sdf/sdf_test_times_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothings/stb/f58f558c120e9b32c217290b80bad1a0729fbb2c/tests/sdf/sdf_test_times_50.png -------------------------------------------------------------------------------- /tests/stb.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "c_lexer_test"=.\c_lexer_test.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "herringbone"=.\herringbone.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "herringbone_map"=.\herringbone_map.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "image_test"=.\image_test.dsp - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "make_readme"=..\tools\make_readme.dsp - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | }}} 63 | 64 | ############################################################################### 65 | 66 | Project: "resize"=.\resize.dsp - Package Owner=<4> 67 | 68 | Package=<5> 69 | {{{ 70 | }}} 71 | 72 | Package=<4> 73 | {{{ 74 | }}} 75 | 76 | ############################################################################### 77 | 78 | Project: "stb"=.\stb.dsp - Package Owner=<4> 79 | 80 | Package=<5> 81 | {{{ 82 | }}} 83 | 84 | Package=<4> 85 | {{{ 86 | Begin Project Dependency 87 | Project_Dep_Name stb_cpp 88 | End Project Dependency 89 | Begin Project Dependency 90 | Project_Dep_Name image_test 91 | End Project Dependency 92 | Begin Project Dependency 93 | Project_Dep_Name c_lexer_test 94 | End Project Dependency 95 | }}} 96 | 97 | ############################################################################### 98 | 99 | Project: "stb_cpp"=.\stb_cpp.dsp - Package Owner=<4> 100 | 101 | Package=<5> 102 | {{{ 103 | }}} 104 | 105 | Package=<4> 106 | {{{ 107 | }}} 108 | 109 | ############################################################################### 110 | 111 | Project: "stblib"=.\stblib.dsp - Package Owner=<4> 112 | 113 | Package=<5> 114 | {{{ 115 | }}} 116 | 117 | Package=<4> 118 | {{{ 119 | }}} 120 | 121 | ############################################################################### 122 | 123 | Project: "unicode"=..\tools\unicode\unicode.dsp - Package Owner=<4> 124 | 125 | Package=<5> 126 | {{{ 127 | }}} 128 | 129 | Package=<4> 130 | {{{ 131 | }}} 132 | 133 | ############################################################################### 134 | 135 | Project: "vorbseek"=.\vorbseek\vorbseek.dsp - Package Owner=<4> 136 | 137 | Package=<5> 138 | {{{ 139 | }}} 140 | 141 | Package=<4> 142 | {{{ 143 | }}} 144 | 145 | ############################################################################### 146 | 147 | Global: 148 | 149 | Package=<5> 150 | {{{ 151 | }}} 152 | 153 | Package=<3> 154 | {{{ 155 | }}} 156 | 157 | ############################################################################### 158 | 159 | -------------------------------------------------------------------------------- /tests/stb_c_lexer_fuzzer.cpp: -------------------------------------------------------------------------------- 1 | #define STB_C_LEX_C_DECIMAL_INTS Y 2 | #define STB_C_LEX_C_HEX_INTS Y 3 | #define STB_C_LEX_C_OCTAL_INTS Y 4 | #define STB_C_LEX_C_DECIMAL_FLOATS Y 5 | #define STB_C_LEX_C99_HEX_FLOATS Y 6 | #define STB_C_LEX_C_IDENTIFIERS Y 7 | #define STB_C_LEX_C_DQ_STRINGS Y 8 | #define STB_C_LEX_C_SQ_STRINGS Y 9 | #define STB_C_LEX_C_CHARS Y 10 | #define STB_C_LEX_C_COMMENTS Y 11 | #define STB_C_LEX_CPP_COMMENTS Y 12 | #define STB_C_LEX_C_COMPARISONS Y 13 | #define STB_C_LEX_C_LOGICAL Y 14 | #define STB_C_LEX_C_SHIFTS Y 15 | #define STB_C_LEX_C_INCREMENTS Y 16 | #define STB_C_LEX_C_ARROW Y 17 | #define STB_C_LEX_EQUAL_ARROW Y 18 | #define STB_C_LEX_C_BITWISEEQ Y 19 | #define STB_C_LEX_C_ARITHEQ Y 20 | 21 | #define STB_C_LEX_PARSE_SUFFIXES Y 22 | #define STB_C_LEX_DECIMAL_SUFFIXES "uUlL" 23 | #define STB_C_LEX_HEX_SUFFIXES "lL" 24 | #define STB_C_LEX_OCTAL_SUFFIXES "lL" 25 | #define STB_C_LEX_FLOAT_SUFFIXES "uulL" 26 | 27 | #define STB_C_LEX_0_IS_EOF N 28 | #define STB_C_LEX_INTEGERS_AS_DOUBLES N 29 | #define STB_C_LEX_MULTILINE_DSTRINGS Y 30 | #define STB_C_LEX_MULTILINE_SSTRINGS Y 31 | #define STB_C_LEX_USE_STDLIB N 32 | #define STB_C_LEX_DOLLAR_IDENTIFIER Y 33 | #define STB_C_LEX_FLOAT_NO_DECIMAL Y 34 | 35 | #define STB_C_LEX_DEFINE_ALL_TOKEN_NAMES Y 36 | #define STB_C_LEX_DISCARD_PREPROCESSOR Y 37 | #define STB_C_LEXER_DEFINITIONS 38 | 39 | #define STB_C_LEXER_IMPLEMENTATION 40 | #define STB_C_LEXER_SELF_TEST 41 | #include "../stb_c_lexer.h" 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | 48 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 49 | { 50 | if(size<3){ 51 | return 0; 52 | } 53 | char *input_stream = (char *)malloc(size); 54 | if (input_stream == NULL){ 55 | return 0; 56 | } 57 | memcpy(input_stream, data, size); 58 | 59 | stb_lexer lex; 60 | char *input_end = input_stream+size-1; 61 | char *store = (char *)malloc(0x10000); 62 | int len = 0x10000; 63 | 64 | stb_c_lexer_init(&lex, input_stream, input_end, store, len); 65 | while (stb_c_lexer_get_token(&lex)) { 66 | if (lex.token == CLEX_parse_error) { 67 | break; 68 | } 69 | } 70 | 71 | free(input_stream); 72 | free(store); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /tests/stb_cpp.cpp: -------------------------------------------------------------------------------- 1 | #define WIN32_MEAN_AND_LEAN 2 | #define WIN32_LEAN_AND_MEAN 3 | //#include 4 | #include 5 | #define STB_DEFINE 6 | #ifndef _M_AMD64 7 | #define STB_NPTR 8 | #endif 9 | #define STB_ONLY 10 | #include "stb.h" 11 | //#include "stb_file.h" 12 | 13 | int count; 14 | void c(int truth, const char *error) 15 | { 16 | if (!truth) { 17 | fprintf(stderr, "Test failed: %s\n", error); 18 | ++count; 19 | } 20 | } 21 | 22 | char *expects(stb_matcher *m, char *s, int result, int len, const char *str) 23 | { 24 | int res2,len2=0; 25 | res2 = stb_lex(m, s, &len2); 26 | c(result == res2 && len == len2, str); 27 | return s + len; 28 | } 29 | 30 | void test_lex(void) 31 | { 32 | stb_matcher *m = stb_lex_matcher(); 33 | // tok_en5 .3 20.1 20. .20 .1 34 | char *s = (char*) "tok_en5.3 20.1 20. .20.1"; 35 | 36 | stb_lex_item(m, "[a-zA-Z_][a-zA-Z0-9_]*", 1 ); 37 | stb_lex_item(m, "[0-9]*\\.?[0-9]*" , 2 ); 38 | stb_lex_item(m, "[\r\n\t ]+" , 3 ); 39 | stb_lex_item(m, "." , -99 ); 40 | s=expects(m,s,1,7, "stb_lex 1"); 41 | s=expects(m,s,2,2, "stb_lex 2"); 42 | s=expects(m,s,3,1, "stb_lex 3"); 43 | s=expects(m,s,2,4, "stb_lex 4"); 44 | s=expects(m,s,3,1, "stb_lex 5"); 45 | s=expects(m,s,2,3, "stb_lex 6"); 46 | s=expects(m,s,3,1, "stb_lex 7"); 47 | s=expects(m,s,2,3, "stb_lex 8"); 48 | s=expects(m,s,2,2, "stb_lex 9"); 49 | s=expects(m,s,0,0, "stb_lex 10"); 50 | stb_matcher_free(m); 51 | } 52 | 53 | int main(int argc, char **argv) 54 | { 55 | #if 0 56 | char *p; 57 | p = (char*) "abcdefghijklmnopqrstuvwxyz"; 58 | c(stb_ischar('c', p), "stb_ischar 1"); 59 | c(stb_ischar('x', p), "stb_ischar 2"); 60 | c(!stb_ischar('#', p), "stb_ischar 3"); 61 | c(!stb_ischar('X', p), "stb_ischar 4"); 62 | p = (char*) "0123456789"; 63 | c(!stb_ischar('c', p), "stb_ischar 5"); 64 | c(!stb_ischar('x', p), "stb_ischar 6"); 65 | c(!stb_ischar('#', p), "stb_ischar 7"); 66 | c(!stb_ischar('X', p), "stb_ischar 8"); 67 | p = (char*) "#####"; 68 | c(!stb_ischar('c', p), "stb_ischar a"); 69 | c(!stb_ischar('x', p), "stb_ischar b"); 70 | c(stb_ischar('#', p), "stb_ischar c"); 71 | c(!stb_ischar('X', p), "stb_ischar d"); 72 | p = (char*) "xXyY"; 73 | c(!stb_ischar('c', p), "stb_ischar e"); 74 | c(stb_ischar('x', p), "stb_ischar f"); 75 | c(!stb_ischar('#', p), "stb_ischar g"); 76 | c(stb_ischar('X', p), "stb_ischar h"); 77 | #endif 78 | 79 | test_lex(); 80 | 81 | if (count) { 82 | _getch(); 83 | } 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /tests/stb_cpp.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="stb_cpp" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=stb_cpp - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "stb_cpp.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "stb_cpp.mak" CFG="stb_cpp - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "stb_cpp - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "stb_cpp - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "stb_cpp - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /MT /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "stb_cpp - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug\stb_cpp" 65 | # PROP Ignore_Export_Lib 0 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD CPP /nologo /MTd /W3 /GX /Zd /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "stb_cpp - Win32 Release" 84 | # Name "stb_cpp - Win32 Debug" 85 | # Begin Source File 86 | 87 | SOURCE=.\stb_cpp.cpp 88 | # End Source File 89 | # Begin Source File 90 | 91 | SOURCE=..\stb_vorbis.c 92 | # End Source File 93 | # Begin Source File 94 | 95 | SOURCE=.\test_cpp_compilation.cpp 96 | # End Source File 97 | # End Target 98 | # End Project 99 | -------------------------------------------------------------------------------- /tests/stb_png.dict: -------------------------------------------------------------------------------- 1 | header_png="\x89PNG\x0d\x0a\x1a\x0a" 2 | 3 | section_idat="IDAT" 4 | section_iend="IEND" 5 | section_ihdr="IHDR" 6 | section_plte="PLTE" 7 | section_trns="tRNS" 8 | section_cgbi="CgBI" 9 | -------------------------------------------------------------------------------- /tests/stb_static.c: -------------------------------------------------------------------------------- 1 | #define STBI_WINDOWS_UTF8 2 | #define STB_IMAGE_STATIC 3 | #define STB_IMAGE_IMPLEMENTATION 4 | #include "stb_image.h" 5 | 6 | #define STB_IMAGE_WRITE_STATIC 7 | #define STB_IMAGE_WRITE_IMPLEMENTATION 8 | //#include "stb_image_write.h" 9 | 10 | #define STBTT_STATIC 11 | #define STB_TRUETYPE_IMPLEMENTATION 12 | #include "stb_truetype.h" 13 | -------------------------------------------------------------------------------- /tests/stbi_read_fuzzer.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | #define STB_IMAGE_IMPLEMENTATION 6 | 7 | #include "../stb_image.h" 8 | 9 | 10 | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 11 | { 12 | int x, y, channels; 13 | 14 | if(!stbi_info_from_memory(data, size, &x, &y, &channels)) return 0; 15 | 16 | /* exit if the image is larger than ~80MB */ 17 | if(y && x > (80000000 / 4) / y) return 0; 18 | 19 | unsigned char *img = stbi_load_from_memory(data, size, &x, &y, &channels, 4); 20 | 21 | free(img); 22 | 23 | return 0; 24 | } 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif -------------------------------------------------------------------------------- /tests/stblib.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="stblib" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=stblib - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "stblib.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "stblib.mak" CFG="stblib - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "stblib - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "stblib - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "stblib - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c 45 | # SUBTRACT CPP /YX 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "stblib - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "Debug" 60 | # PROP BASE Intermediate_Dir "Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "stblib - Win32 Release" 84 | # Name "stblib - Win32 Debug" 85 | # Begin Source File 86 | 87 | SOURCE=.\prerelease\stb_lib.h 88 | # End Source File 89 | # Begin Source File 90 | 91 | SOURCE=..\stb_regex.h 92 | # End Source File 93 | # Begin Source File 94 | 95 | SOURCE=.\stblib_test.c 96 | # End Source File 97 | # Begin Source File 98 | 99 | SOURCE=.\stblib_test_companion.c 100 | # End Source File 101 | # End Target 102 | # End Project 103 | -------------------------------------------------------------------------------- /tests/stblib_test.c: -------------------------------------------------------------------------------- 1 | #include "prerelease/stb_lib.h" 2 | #define STB_LIB_IMPLEMENTATION 3 | #include "prerelease/stb_lib.h" 4 | 5 | //#define STB_REGEX_IMPLEMENTATION 6 | //#include "stb_regex.h" 7 | 8 | int main(int argc, char **argv) 9 | { 10 | 11 | } -------------------------------------------------------------------------------- /tests/stblib_test_companion.c: -------------------------------------------------------------------------------- 1 | //#include "stb_regex.h" 2 | //#include "stb_regex.h" 3 | #include "prerelease/stb_lib.h" 4 | #include "prerelease/stb_lib.h" 5 | -------------------------------------------------------------------------------- /tests/stretch_test.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="stretch_test" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=stretch_test - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "stretch_test.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "stretch_test.mak" CFG="stretch_test - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "stretch_test - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "stretch_test - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "stretch_test - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /I "..\.." /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TT_TEST" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "stretch_test - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "stretch_test___Win32_Debug" 59 | # PROP BASE Intermediate_Dir "stretch_test___Win32_Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug\stretch_test" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 68 | # SUBTRACT CPP /YX 69 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 70 | # ADD RSC /l 0x409 /d "_DEBUG" 71 | BSC32=bscmake.exe 72 | # ADD BASE BSC32 /nologo 73 | # ADD BSC32 /nologo 74 | LINK32=link.exe 75 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | 78 | !ENDIF 79 | 80 | # Begin Target 81 | 82 | # Name "stretch_test - Win32 Release" 83 | # Name "stretch_test - Win32 Debug" 84 | # Begin Source File 85 | 86 | SOURCE=.\stretch_test.c 87 | # End Source File 88 | # End Target 89 | # End Project 90 | -------------------------------------------------------------------------------- /tests/test.sbm: -------------------------------------------------------------------------------- 1 | [link] 2 | -Xlinker advapi32.lib 3 | 4 | [args] 5 | -I .. -Wall -D_DEBUG 6 | 7 | [compilers] 8 | #clang for x64,vcvars_2015_x64,clang --analyze 9 | clang for x64,vcvars_2015_x64,clang 10 | clang for x86,vcvars_2015_x86,clang --target=i386-pc-windows-msvc 11 | 12 | ##### STATIC ANALYSIS 13 | # 14 | #[link] 15 | # 16 | #[args] 17 | #-I .. -Wall -D_DEBUG 18 | # 19 | #[compilers] 20 | #clang for x64,vcvars_2015_x64,clang --analyze 21 | # 22 | ##### 23 | 24 | [link] 25 | advapi32.lib 26 | 27 | [args] 28 | /nologo -I .. -W3 -WX -D_DEBUG 29 | 30 | [compilers] 31 | VS2015 for x64, vcvars_2015_x64 32 | VC6 , vcvars_vc6 33 | VS2008 for x86, vcvars_2008_x86 34 | VS2013 for x86, vcvars_2013_x86 35 | VS2015 for x86, vcvars_2015_x86 36 | clang-cl for x64, vcvars_2015_x64, clang-cl 37 | clang-cl for x86, vcvars_2015_x86, clang-cl --target=i386-pc-windows-msvc 38 | #these batch files don't path a cl executable on my machine?!? 39 | #VS2008 for x64, vcvars_2008_x64 40 | #VS2013 for x64, vcvars_2013_x64 41 | 42 | [projects] 43 | c_lexer_test.c 44 | image_test.c image_write_test.c 45 | test_cpp_compilation.cpp stb_cpp.cpp ../stb_vorbis.c 46 | resample_test.cpp 47 | -DTT_TEST test_c_compilation.c test_truetype.c 48 | main.c stb.c 49 | main.c stretchy_buffer_test.c 50 | main.c test_c_compilation.c 51 | main.c test_c_lexer.c 52 | main.c test_dxt.c 53 | main.c test_easyfont.c 54 | main.c test_image.c 55 | main.c test_image_write.c 56 | main.c test_perlin.c 57 | main.c test_sprintf.c 58 | main.c test_vorbis.c ../stb_vorbis.c 59 | main.c test_voxel.c 60 | main.c textedit_sample.c 61 | -------------------------------------------------------------------------------- /tests/test_c_compilation.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_RESIZE_IMPLEMENTATION 2 | #include "stb_image_resize2.h" 3 | 4 | #define STB_SPRINTF_IMPLEMENTATION 5 | #include "stb_sprintf.h" 6 | 7 | #define STB_PERLIN_IMPLEMENTATION 8 | #define STB_IMAGE_WRITE_IMPLEMENTATION 9 | #define STB_C_LEXER_IMPLEMENTATIOn 10 | #define STB_DIVIDE_IMPLEMENTATION 11 | #define STB_IMAGE_IMPLEMENTATION 12 | #define STB_HERRINGBONE_WANG_TILE_IMEPLEMENTATIOn 13 | #define STB_RECT_PACK_IMPLEMENTATION 14 | #define STB_VOXEL_RENDER_IMPLEMENTATION 15 | #define STB_EASY_FONT_IMPLEMENTATION 16 | #define STB_DXT_IMPLEMENTATION 17 | #define STB_INCLUDE_IMPLEMENTATION 18 | 19 | #include "stb_herringbone_wang_tile.h" 20 | #include "stb_image.h" 21 | #include "stb_image_write.h" 22 | #include "stb_perlin.h" 23 | #include "stb_c_lexer.h" 24 | #include "stb_divide.h" 25 | #include "stb_rect_pack.h" 26 | #include "stb_dxt.h" 27 | #include "stb_include.h" 28 | 29 | #include "stb_ds.h" 30 | 31 | #define STBVOX_CONFIG_MODE 1 32 | #include "stb_voxel_render.h" 33 | 34 | void STBTE_DRAW_RECT(int x0, int y0, int x1, int y1, unsigned int color) 35 | { 36 | } 37 | 38 | void STBTE_DRAW_TILE(int x0, int y0, unsigned short id, int highlight, float *data) 39 | { 40 | } 41 | 42 | #define STB_TILEMAP_EDITOR_IMPLEMENTATION 43 | //#include "stb_tilemap_editor.h" // @TODO: it's broken 44 | 45 | int quicktest(void) 46 | { 47 | char buffer[999]; 48 | stbsp_sprintf(buffer, "test%%test"); 49 | return 0; 50 | } -------------------------------------------------------------------------------- /tests/test_c_lexer.c: -------------------------------------------------------------------------------- 1 | #include "stb_c_lexer.h" 2 | 3 | #define STB_C_LEX_C_DECIMAL_INTS Y // "0|[1-9][0-9]*" CLEX_intlit 4 | #define STB_C_LEX_C_HEX_INTS Y // "0x[0-9a-fA-F]+" CLEX_intlit 5 | #define STB_C_LEX_C_OCTAL_INTS Y // "[0-7]+" CLEX_intlit 6 | #define STB_C_LEX_C_DECIMAL_FLOATS Y // "[0-9]*(.[0-9]*([eE][-+]?[0-9]+)?) CLEX_floatlit 7 | #define STB_C_LEX_C99_HEX_FLOATS N // "0x{hex}+(.{hex}*)?[pP][-+]?{hex}+ CLEX_floatlit 8 | #define STB_C_LEX_C_IDENTIFIERS Y // "[_a-zA-Z][_a-zA-Z0-9]*" CLEX_id 9 | #define STB_C_LEX_C_DQ_STRINGS Y // double-quote-delimited strings with escapes CLEX_dqstring 10 | #define STB_C_LEX_C_SQ_STRINGS N // single-quote-delimited strings with escapes CLEX_ssstring 11 | #define STB_C_LEX_C_CHARS Y // single-quote-delimited character with escape CLEX_charlits 12 | #define STB_C_LEX_C_COMMENTS Y // "/* comment */" 13 | #define STB_C_LEX_CPP_COMMENTS Y // "// comment to end of line\n" 14 | #define STB_C_LEX_C_COMPARISONS Y // "==" CLEX_eq "!=" CLEX_noteq "<=" CLEX_lesseq ">=" CLEX_greatereq 15 | #define STB_C_LEX_C_LOGICAL Y // "&&" CLEX_andand "||" CLEX_oror 16 | #define STB_C_LEX_C_SHIFTS Y // "<<" CLEX_shl ">>" CLEX_shr 17 | #define STB_C_LEX_C_INCREMENTS Y // "++" CLEX_plusplus "--" CLEX_minusminus 18 | #define STB_C_LEX_C_ARROW Y // "->" CLEX_arrow 19 | #define STB_C_LEX_EQUAL_ARROW N // "=>" CLEX_eqarrow 20 | #define STB_C_LEX_C_BITWISEEQ Y // "&=" CLEX_andeq "|=" CLEX_oreq "^=" CLEX_xoreq 21 | #define STB_C_LEX_C_ARITHEQ Y // "+=" CLEX_pluseq "-=" CLEX_minuseq 22 | // "*=" CLEX_muleq "/=" CLEX_diveq "%=" CLEX_modeq 23 | // if both STB_C_LEX_SHIFTS & STB_C_LEX_ARITHEQ: 24 | // "<<=" CLEX_shleq ">>=" CLEX_shreq 25 | 26 | #define STB_C_LEX_PARSE_SUFFIXES N // letters after numbers are parsed as part of those numbers, and must be in suffix list below 27 | #define STB_C_LEX_DECIMAL_SUFFIXES "" // decimal integer suffixes e.g. "uUlL" -- these are returned as-is in string storage 28 | #define STB_C_LEX_HEX_SUFFIXES "" // e.g. "uUlL" 29 | #define STB_C_LEX_OCTAL_SUFFIXES "" // e.g. "uUlL" 30 | #define STB_C_LEX_FLOAT_SUFFIXES "" // 31 | 32 | #define STB_C_LEX_0_IS_EOF Y // if Y, ends parsing at '\0'; if N, returns '\0' as token 33 | #define STB_C_LEX_INTEGERS_AS_DOUBLES N // parses integers as doubles so they can be larger than 'int', but only if STB_C_LEX_STDLIB==N 34 | #define STB_C_LEX_MULTILINE_DSTRINGS N // allow newlines in double-quoted strings 35 | #define STB_C_LEX_MULTILINE_SSTRINGS N // allow newlines in single-quoted strings 36 | #define STB_C_LEX_USE_STDLIB Y // use strtod,strtol for parsing #s; otherwise inaccurate hack 37 | #define STB_C_LEX_DOLLAR_IDENTIFIER Y // allow $ as an identifier character 38 | #define STB_C_LEX_FLOAT_NO_DECIMAL Y // allow floats that have no decimal point if they have an exponent 39 | 40 | #define STB_C_LEX_DEFINE_ALL_TOKEN_NAMES N // if Y, all CLEX_ token names are defined, even if never returned 41 | // leaving it as N should help you catch config bugs 42 | 43 | #define STB_C_LEX_DISCARD_PREPROCESSOR Y // discard C-preprocessor directives (e.g. after prepocess 44 | // still have #line, #pragma, etc) 45 | 46 | //#define STB_C_LEX_ISWHITE(str) ... // return length in bytes of whitespace characters if first char is whitespace 47 | 48 | #define STB_C_LEXER_DEFINITIONS // This line prevents the header file from replacing your definitions 49 | 50 | #include "stb_c_lexer.h" 51 | -------------------------------------------------------------------------------- /tests/test_dxt.c: -------------------------------------------------------------------------------- 1 | #include "stb_dxt.h" 2 | -------------------------------------------------------------------------------- /tests/test_easyfont.c: -------------------------------------------------------------------------------- 1 | #include "stb_easy_font.h" 2 | 3 | void ef_dummy(void) 4 | { 5 | // suppress unsused-function warning 6 | stb_easy_font_spacing(0); 7 | stb_easy_font_print(0,0,0,0,0,0); 8 | stb_easy_font_width(0); 9 | stb_easy_font_height(0); 10 | } -------------------------------------------------------------------------------- /tests/test_image.c: -------------------------------------------------------------------------------- 1 | #ifdef __clang__ 2 | #define STBIDEF static inline 3 | #endif 4 | 5 | #define STB_IMAGE_STATIC 6 | #define STB_IMAGE_IMPLEMENTATION 7 | #include "stb_image.h" -------------------------------------------------------------------------------- /tests/test_image_write.c: -------------------------------------------------------------------------------- 1 | #ifdef __clang__ 2 | #define STBIWDEF static inline 3 | #endif 4 | 5 | #define STB_IMAGE_WRITE_IMPLEMENTATION 6 | #define STB_IMAGE_WRITE_STATIC 7 | #include "stb_image_write.h" -------------------------------------------------------------------------------- /tests/test_perlin.c: -------------------------------------------------------------------------------- 1 | #include "stb_perlin.h" -------------------------------------------------------------------------------- /tests/test_png_paeth.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // Reference Paeth filter as per PNG spec 5 | static int ref_paeth(int a, int b, int c) 6 | { 7 | int p = a + b - c; 8 | int pa = abs(p-a); 9 | int pb = abs(p-b); 10 | int pc = abs(p-c); 11 | if (pa <= pb && pa <= pc) return a; 12 | if (pb <= pc) return b; 13 | return c; 14 | } 15 | 16 | // Optimized Paeth filter 17 | static int opt_paeth(int a, int b, int c) 18 | { 19 | int thresh = c*3 - (a + b); 20 | int lo = a < b ? a : b; 21 | int hi = a < b ? b : a; 22 | int t0 = (hi <= thresh) ? lo : c; 23 | int t1 = (thresh <= lo) ? hi : t0; 24 | return t1; 25 | } 26 | 27 | int main() 28 | { 29 | // Exhaustively test the functions match for all byte inputs a, b,c in [0,255] 30 | for (int i = 0; i < (1 << 24); ++i) { 31 | int a = i & 0xff; 32 | int b = (i >> 8) & 0xff; 33 | int c = (i >> 16) & 0xff; 34 | 35 | int ref = ref_paeth(a, b, c); 36 | int opt = opt_paeth(a, b, c); 37 | if (ref != opt) { 38 | fprintf(stderr, "mismatch at a=%3d b=%3d c=%3d: ref=%3d opt=%3d\n", a, b, c, ref, opt); 39 | return 1; 40 | } 41 | } 42 | 43 | printf("all ok!\n"); 44 | return 0; 45 | } 46 | 47 | // vim:sw=3:sts=3:et 48 | -------------------------------------------------------------------------------- /tests/test_png_regress.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define STBI_WINDOWS_UTF8 5 | 6 | #ifdef _WIN32 7 | #define WIN32 // what stb.h checks 8 | #pragma comment(lib, "advapi32.lib") 9 | #endif 10 | 11 | #define STB_IMAGE_IMPLEMENTATION 12 | #include "stb_image.h" 13 | 14 | #define STB_DEFINE 15 | #include "deprecated/stb.h" 16 | 17 | static unsigned int fnv1a_hash32(const stbi_uc *bytes, size_t len) 18 | { 19 | unsigned int hash = 0x811c9dc5; 20 | unsigned int mul = 0x01000193; 21 | size_t i; 22 | 23 | for (i = 0; i < len; ++i) 24 | hash = (hash ^ bytes[i]) * mul; 25 | 26 | return hash; 27 | } 28 | 29 | // The idea for this test is to leave pngsuite/ref_results.csv checked in, 30 | // and then you can run this test after making PNG loader changes. If the 31 | // ref results change (as per git diff), confirm that the change was 32 | // intentional. If so, commit them as well; if not, undo. 33 | int main() 34 | { 35 | char **files; 36 | FILE *csv_file; 37 | int i; 38 | 39 | files = stb_readdir_recursive("pngsuite", "*.png"); 40 | if (!files) { 41 | fprintf(stderr, "pngsuite files not found!\n"); 42 | return 1; 43 | } 44 | 45 | // sort files by name 46 | qsort(files, stb_arr_len(files), sizeof(char*), stb_qsort_strcmp(0)); 47 | 48 | csv_file = fopen("pngsuite/ref_results.csv", "w"); 49 | if (!csv_file) { 50 | fprintf(stderr, "error opening ref results for writing!\n"); 51 | stb_readdir_free(files); 52 | return 1; 53 | } 54 | 55 | fprintf(csv_file, "filename,width,height,ncomp,error,hash\n"); 56 | for (i = 0; i < stb_arr_len(files); ++i) { 57 | char *filename = files[i]; 58 | int width, height, ncomp; 59 | stbi_uc *pixels = stbi_load(filename, &width, &height, &ncomp, 0); 60 | const char *error = ""; 61 | unsigned int hash = 0; 62 | 63 | if (!pixels) 64 | error = stbi_failure_reason(); 65 | else { 66 | hash = fnv1a_hash32(pixels, width * height * ncomp); 67 | stbi_image_free(pixels); 68 | } 69 | 70 | fprintf(csv_file, "%s,%d,%d,%d,%s,0x%08x\n", filename, width, height, ncomp, error, hash); 71 | } 72 | 73 | fclose(csv_file); 74 | stb_readdir_free(files); 75 | } 76 | -------------------------------------------------------------------------------- /tests/test_siphash.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STB_DS_IMPLEMENTATION 4 | #define STBDS_SIPHASH_2_4 5 | #define STBDS_TEST_SIPHASH_2_4 6 | #include "../stb_ds.h" 7 | 8 | int main(int argc, char **argv) 9 | { 10 | unsigned char mem[64]; 11 | int i,j; 12 | for (i=0; i < 64; ++i) mem[i] = i; 13 | for (i=0; i < 64; ++i) { 14 | size_t hash = stbds_hash_bytes(mem, i, 0); 15 | printf(" { "); 16 | for (j=0; j < 8; ++j) 17 | printf("0x%02x, ", (unsigned char) ((hash >> (j*8)) & 255)); 18 | printf(" },\n"); 19 | } 20 | return 0; 21 | } -------------------------------------------------------------------------------- /tests/test_vorbis.c: -------------------------------------------------------------------------------- 1 | #define STB_VORBIS_HEADER_ONLY 2 | #include "stb_vorbis.c" 3 | #include "stb.h" 4 | 5 | extern void stb_vorbis_dumpmem(void); 6 | 7 | #ifdef VORBIS_TEST 8 | int main(int argc, char **argv) 9 | { 10 | size_t memlen; 11 | unsigned char *mem = stb_fileu("../../lib/vorbis/sample/sketch008.ogg", &memlen); 12 | int chan, samplerate; 13 | short *output; 14 | int samples = stb_vorbis_decode_memory(mem, memlen, &chan, &samplerate, &output); 15 | stb_filewrite("c:/x/sketch008.raw", output, samples*4); 16 | return 0; 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /tests/test_voxel.c: -------------------------------------------------------------------------------- 1 | #include "stb_voxel_render.h" -------------------------------------------------------------------------------- /tests/textedit_sample.c: -------------------------------------------------------------------------------- 1 | // I haven't actually tested this yet, this is just to make sure it compiles 2 | 3 | #include 4 | #include // memmove 5 | #include // isspace 6 | 7 | #define STB_TEXTEDIT_CHARTYPE char 8 | #define STB_TEXTEDIT_STRING text_control 9 | 10 | // get the base type 11 | #include "stb_textedit.h" 12 | 13 | // define our editor structure 14 | typedef struct 15 | { 16 | char *string; 17 | int stringlen; 18 | STB_TexteditState state; 19 | } text_control; 20 | 21 | // define the functions we need 22 | void layout_func(StbTexteditRow *row, STB_TEXTEDIT_STRING *str, int start_i) 23 | { 24 | int remaining_chars = str->stringlen - start_i; 25 | row->num_chars = remaining_chars > 20 ? 20 : remaining_chars; // should do real word wrap here 26 | row->x0 = 0; 27 | row->x1 = 20; // need to account for actual size of characters 28 | row->baseline_y_delta = 1.25; 29 | row->ymin = -1; 30 | row->ymax = 0; 31 | } 32 | 33 | int delete_chars(STB_TEXTEDIT_STRING *str, int pos, int num) 34 | { 35 | memmove(&str->string[pos], &str->string[pos+num], str->stringlen - (pos+num)); 36 | str->stringlen -= num; 37 | return 1; // always succeeds 38 | } 39 | 40 | int insert_chars(STB_TEXTEDIT_STRING *str, int pos, STB_TEXTEDIT_CHARTYPE *newtext, int num) 41 | { 42 | str->string = realloc(str->string, str->stringlen + num); 43 | memmove(&str->string[pos+num], &str->string[pos], str->stringlen - pos); 44 | memcpy(&str->string[pos], newtext, num); 45 | str->stringlen += num; 46 | return 1; // always succeeds 47 | } 48 | 49 | // define all the #defines needed 50 | 51 | #define KEYDOWN_BIT 0x80000000 52 | 53 | #define STB_TEXTEDIT_STRINGLEN(tc) ((tc)->stringlen) 54 | #define STB_TEXTEDIT_LAYOUTROW layout_func 55 | #define STB_TEXTEDIT_GETWIDTH(tc,n,i) (1) // quick hack for monospaced 56 | #define STB_TEXTEDIT_KEYTOTEXT(key) (((key) & KEYDOWN_BIT) ? 0 : (key)) 57 | #define STB_TEXTEDIT_GETCHAR(tc,i) ((tc)->string[i]) 58 | #define STB_TEXTEDIT_NEWLINE '\n' 59 | #define STB_TEXTEDIT_IS_SPACE(ch) isspace(ch) 60 | #define STB_TEXTEDIT_DELETECHARS delete_chars 61 | #define STB_TEXTEDIT_INSERTCHARS insert_chars 62 | 63 | #define STB_TEXTEDIT_K_SHIFT 0x40000000 64 | #define STB_TEXTEDIT_K_CONTROL 0x20000000 65 | #define STB_TEXTEDIT_K_LEFT (KEYDOWN_BIT | 1) // actually use VK_LEFT, SDLK_LEFT, etc 66 | #define STB_TEXTEDIT_K_RIGHT (KEYDOWN_BIT | 2) // VK_RIGHT 67 | #define STB_TEXTEDIT_K_UP (KEYDOWN_BIT | 3) // VK_UP 68 | #define STB_TEXTEDIT_K_DOWN (KEYDOWN_BIT | 4) // VK_DOWN 69 | #define STB_TEXTEDIT_K_LINESTART (KEYDOWN_BIT | 5) // VK_HOME 70 | #define STB_TEXTEDIT_K_LINEEND (KEYDOWN_BIT | 6) // VK_END 71 | #define STB_TEXTEDIT_K_TEXTSTART (STB_TEXTEDIT_K_LINESTART | STB_TEXTEDIT_K_CONTROL) 72 | #define STB_TEXTEDIT_K_TEXTEND (STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_CONTROL) 73 | #define STB_TEXTEDIT_K_DELETE (KEYDOWN_BIT | 7) // VK_DELETE 74 | #define STB_TEXTEDIT_K_BACKSPACE (KEYDOWN_BIT | 8) // VK_BACKSPACE 75 | #define STB_TEXTEDIT_K_UNDO (KEYDOWN_BIT | STB_TEXTEDIT_K_CONTROL | 'z') 76 | #define STB_TEXTEDIT_K_REDO (KEYDOWN_BIT | STB_TEXTEDIT_K_CONTROL | 'y') 77 | #define STB_TEXTEDIT_K_INSERT (KEYDOWN_BIT | 9) // VK_INSERT 78 | #define STB_TEXTEDIT_K_WORDLEFT (STB_TEXTEDIT_K_LEFT | STB_TEXTEDIT_K_CONTROL) 79 | #define STB_TEXTEDIT_K_WORDRIGHT (STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_CONTROL) 80 | #define STB_TEXTEDIT_K_PGUP (KEYDOWN_BIT | 10) // VK_PGUP -- not implemented 81 | #define STB_TEXTEDIT_K_PGDOWN (KEYDOWN_BIT | 11) // VK_PGDOWN -- not implemented 82 | 83 | #define STB_TEXTEDIT_IMPLEMENTATION 84 | #include "stb_textedit.h" 85 | 86 | void dummy3(void) 87 | { 88 | stb_textedit_click(0,0,0,0); 89 | stb_textedit_drag(0,0,0,0); 90 | stb_textedit_cut(0,0); 91 | stb_textedit_key(0,0,0); 92 | stb_textedit_initialize_state(0,0); 93 | stb_textedit_paste(0,0,0,0); 94 | } 95 | -------------------------------------------------------------------------------- /tests/vorbseek/vorbseek.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define STB_VORBIS_HEADER_ONLY 7 | #include "stb_vorbis.c" 8 | 9 | #define SAMPLES_TO_TEST 3000 10 | 11 | int test_count [5] = { 5000, 3000, 2000, 50000, 50000 }; 12 | int test_spacing[5] = { 1, 111, 3337, 7779, 72717 }; 13 | 14 | int try_seeking(stb_vorbis *v, unsigned int pos, short *output, unsigned int num_samples) 15 | { 16 | int count; 17 | short samples[SAMPLES_TO_TEST*2]; 18 | assert(pos <= num_samples); 19 | 20 | if (!stb_vorbis_seek(v, pos)) { 21 | fprintf(stderr, "Seek to %u returned error from stb_vorbis\n", pos); 22 | return 0; 23 | } 24 | 25 | count = stb_vorbis_get_samples_short_interleaved(v, 2, samples, SAMPLES_TO_TEST*2); 26 | 27 | if (count > (int) (num_samples - pos)) { 28 | fprintf(stderr, "Seek to %u allowed decoding %d samples when only %d should have been valid.\n", 29 | pos, count, (int) (num_samples - pos)); 30 | return 0; 31 | } 32 | 33 | if (count < SAMPLES_TO_TEST && count < (int) (num_samples - pos)) { 34 | fprintf(stderr, "Seek to %u only decoded %d samples of %d attempted when at least %d should have been valid.\n", 35 | pos, count, SAMPLES_TO_TEST, num_samples - pos); 36 | return 0; 37 | } 38 | 39 | if (0 != memcmp(samples, output + pos*2, count*2)) { 40 | int k; 41 | for (k=0; k < SAMPLES_TO_TEST*2; ++k) { 42 | if (samples[k] != output[k]) { 43 | fprintf(stderr, "Seek to %u produced incorrect samples starting at sample %u (short #%d in buffer).\n", 44 | pos, pos + (k/2), k); 45 | break; 46 | } 47 | } 48 | assert(k != SAMPLES_TO_TEST*2); 49 | return 0; 50 | } 51 | 52 | return 1; 53 | } 54 | 55 | int main(int argc, char **argv) 56 | { 57 | int num_chan, samprate; 58 | int i, j, test, phase; 59 | short *output; 60 | 61 | if (argc == 1) { 62 | fprintf(stderr, "Usage: vorbseek {vorbisfile} [{vorbisfile]*]\n"); 63 | fprintf(stderr, "Tests various seek offsets to make sure they're sample exact.\n"); 64 | return 0; 65 | } 66 | 67 | #if 0 68 | { 69 | // check that outofmem occurs correctly 70 | stb_vorbis_alloc va; 71 | va.alloc_buffer = malloc(1024*1024); 72 | for (i=0; i < 1024*1024; i += 10) { 73 | int error=0; 74 | stb_vorbis *v; 75 | va.alloc_buffer_length_in_bytes = i; 76 | v = stb_vorbis_open_filename(argv[1], &error, &va); 77 | if (v != NULL) 78 | break; 79 | printf("Error %d at %d\n", error, i); 80 | } 81 | } 82 | #endif 83 | 84 | for (j=1; j < argc; ++j) { 85 | unsigned int successes=0, attempts = 0; 86 | unsigned int num_samples = stb_vorbis_decode_filename(argv[j], &num_chan, &samprate, &output); 87 | 88 | break; 89 | 90 | if (num_samples == 0xffffffff) { 91 | fprintf(stderr, "Error: couldn't open file or not vorbis file: %s\n", argv[j]); 92 | goto fail; 93 | } 94 | 95 | if (num_chan != 2) { 96 | fprintf(stderr, "vorbseek testing only works with files with 2 channels, %s has %d\n", argv[j], num_chan); 97 | goto fail; 98 | } 99 | 100 | for (test=0; test < 5; ++test) { 101 | int error; 102 | stb_vorbis *v = stb_vorbis_open_filename(argv[j], &error, NULL); 103 | if (v == NULL) { 104 | fprintf(stderr, "Couldn't re-open %s for test #%d\n", argv[j], test); 105 | goto fail; 106 | } 107 | for (phase=0; phase < 3; ++phase) { 108 | unsigned int base = phase == 0 ? 0 : phase == 1 ? num_samples - test_count[test]*test_spacing[test] : num_samples/3; 109 | for (i=0; i < test_count[test]; ++i) { 110 | unsigned int pos = base + i*test_spacing[test]; 111 | if (pos > num_samples) // this also catches underflows 112 | continue; 113 | successes += try_seeking(v, pos, output, num_samples); 114 | attempts += 1; 115 | } 116 | } 117 | stb_vorbis_close(v); 118 | } 119 | printf("%d of %d seeks failed in %s (%d samples)\n", attempts-successes, attempts, argv[j], num_samples); 120 | free(output); 121 | } 122 | return 0; 123 | fail: 124 | return 1; 125 | } -------------------------------------------------------------------------------- /tests/vorbseek/vorbseek.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="vorbseek" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=vorbseek - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "vorbseek.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "vorbseek.mak" CFG="vorbseek - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "vorbseek - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "vorbseek - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "vorbseek - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /W3 /GX /Zd /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c 46 | # SUBTRACT CPP /YX 47 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 48 | # ADD RSC /l 0x409 /d "NDEBUG" 49 | BSC32=bscmake.exe 50 | # ADD BASE BSC32 /nologo 51 | # ADD BSC32 /nologo 52 | LINK32=link.exe 53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 55 | 56 | !ELSEIF "$(CFG)" == "vorbseek - Win32 Debug" 57 | 58 | # PROP BASE Use_MFC 0 59 | # PROP BASE Use_Debug_Libraries 1 60 | # PROP BASE Output_Dir "Debug" 61 | # PROP BASE Intermediate_Dir "Debug" 62 | # PROP BASE Target_Dir "" 63 | # PROP Use_MFC 0 64 | # PROP Use_Debug_Libraries 1 65 | # PROP Output_Dir "Debug" 66 | # PROP Intermediate_Dir "Debug" 67 | # PROP Ignore_Export_Lib 0 68 | # PROP Target_Dir "" 69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 70 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 71 | # SUBTRACT CPP /YX 72 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 73 | # ADD RSC /l 0x409 /d "_DEBUG" 74 | BSC32=bscmake.exe 75 | # ADD BASE BSC32 /nologo 76 | # ADD BSC32 /nologo 77 | LINK32=link.exe 78 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 79 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 80 | 81 | !ENDIF 82 | 83 | # Begin Target 84 | 85 | # Name "vorbseek - Win32 Release" 86 | # Name "vorbseek - Win32 Debug" 87 | # Begin Source File 88 | 89 | SOURCE=..\..\stb_vorbis.c 90 | # End Source File 91 | # Begin Source File 92 | 93 | SOURCE=.\vorbseek.c 94 | # End Source File 95 | # End Target 96 | # End Project 97 | -------------------------------------------------------------------------------- /tools/README.header.md: -------------------------------------------------------------------------------- 1 | stb 2 | === 3 | 4 | single-file public domain (or MIT licensed) libraries for C/C++ 5 | 6 | # This project discusses security-relevant bugs in public in Github Issues and Pull Requests, and it may take significant time for security fixes to be implemented or merged. If this poses an unreasonable risk to your project, do not use stb libraries. 7 | 8 | Noteworthy: 9 | 10 | * image loader: [stb_image.h](stb_image.h) 11 | * image writer: [stb_image_write.h](stb_image_write.h) 12 | * image resizer: [stb_image_resize2.h](stb_image_resize2.h) 13 | * font text rasterizer: [stb_truetype.h](stb_truetype.h) 14 | * typesafe containers: [stb_ds.h](stb_ds.h) 15 | 16 | Most libraries by stb, except: stb_dxt by Fabian "ryg" Giesen, original stb_image_resize 17 | by Jorge L. "VinoBS" Rodriguez, and stb_image_resize2 and stb_sprintf by Jeff Roberts. 18 | 19 | 20 | 21 | library | latest version | category | LoC | description 22 | --------------------- | ---- | -------- | --- | -------------------------------- 23 | -------------------------------------------------------------------------------- /tools/README.list: -------------------------------------------------------------------------------- 1 | stb_vorbis.c | audio | decode ogg vorbis files from file/memory to float/16-bit signed output 2 | stb_hexwave.h | audio | audio waveform synthesizer 3 | stb_image.h | graphics | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC 4 | stb_truetype.h | graphics | parse, decode, and rasterize characters from truetype fonts 5 | stb_image_write.h | graphics | image writing to disk: PNG, TGA, BMP 6 | stb_image_resize2.h | graphics | resize images larger/smaller with good quality 7 | stb_rect_pack.h | graphics | simple 2D rectangle packer with decent quality 8 | stb_perlin.h | graphics | perlin's revised simplex noise w/ different seeds 9 | stb_ds.h | utility | typesafe dynamic array and hash tables for C, will compile in C++ 10 | stb_sprintf.h | utility | fast sprintf, snprintf for C/C++ 11 | stb_textedit.h | user interface | guts of a text editor for games etc implementing them from scratch 12 | stb_voxel_render.h | 3D graphics | Minecraft-esque voxel rendering "engine" with many more features 13 | stb_dxt.h | 3D graphics | Fabian "ryg" Giesen's real-time DXT compressor 14 | stb_easy_font.h | 3D graphics | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc 15 | stb_tilemap_editor.h | game dev | embeddable tilemap editor 16 | stb_herringbone_wang_tile.h | game dev | herringbone Wang tile map generator 17 | stb_c_lexer.h | parsing | simplify writing parsers for C-like languages 18 | stb_divide.h | math | more useful 32-bit modulus e.g. "euclidean divide" 19 | stb_connected_components.h | misc | incrementally compute reachability on grids 20 | stb_leakcheck.h | misc | quick-and-dirty malloc/free leak-checking 21 | stb_include.h | misc | implement recursive #include support, particularly for GLSL 22 | -------------------------------------------------------------------------------- /tools/make_readme.c: -------------------------------------------------------------------------------- 1 | #define STB_DEFINE 2 | #include "../stb.h" 3 | 4 | int main(int argc, char **argv) 5 | { 6 | int i; 7 | int hlen, flen, listlen, total_lines = 0; 8 | char *header = stb_file("README.header.md", &hlen); // stb_file - read file into malloc()ed buffer 9 | char *footer = stb_file("README.footer.md", &flen); // stb_file - read file into malloc()ed buffer 10 | char **list = stb_stringfile("README.list", &listlen); // stb_stringfile - read file lines into malloced array of strings 11 | 12 | FILE *f = fopen("../README.md", "wb"); 13 | 14 | fprintf(f, "\r\n\r\n"); 15 | fwrite(header, 1, hlen, f); 16 | 17 | for (i=0; i < listlen; ++i) { 18 | int num,j; 19 | char **tokens = stb_tokens_stripwhite(list[i], "|", &num); // stb_tokens -- tokenize string into malloced array of strings 20 | int num_lines; 21 | char **lines = stb_stringfile(stb_sprintf("../%s", tokens[0]), &num_lines); 22 | char *s1, *s2,*s3; 23 | if (lines == NULL) stb_fatal("Couldn't open '%s'", tokens[0]); 24 | s1 = strchr(lines[0], '-'); 25 | if (!s1) stb_fatal("Couldn't find '-' before version number in %s", tokens[0]); // stb_fatal -- print error message & exit 26 | s2 = strchr(s1+2, '-'); 27 | if (!s2) stb_fatal("Couldn't find '-' after version number in %s", tokens[0]); // stb_fatal -- print error message & exit 28 | *s2 = 0; 29 | s1 += 1; 30 | s1 = stb_trimwhite(s1); // stb_trimwhite -- advance pointer to after whitespace & delete trailing whitespace 31 | if (*s1 == 'v') ++s1; 32 | s3 = tokens[0]; 33 | stb_trimwhite(s3); 34 | fprintf(f, "**["); 35 | if (strlen(s3) < 21) { 36 | fprintf(f, "%s", tokens[0]); 37 | } else { 38 | char buffer[256]; 39 | strncpy(buffer, s3, 18); 40 | buffer[18] = 0; 41 | strcat(buffer, "..."); 42 | fprintf(f, "%s", buffer); 43 | } 44 | fprintf(f, "](%s)**", tokens[0]); 45 | fprintf(f, " | %s", s1); 46 | s1 = stb_trimwhite(tokens[1]); // stb_trimwhite -- advance pointer to after whitespace & delete trailing whitespace 47 | s2 = stb_dupreplace(s1, " ", " "); // stb_dupreplace -- search & replace string and malloc result 48 | fprintf(f, " | %s", s2); 49 | free(s2); 50 | fprintf(f, " | %d", num_lines); 51 | total_lines += num_lines; 52 | for (j=2; j < num; ++j) 53 | fprintf(f, " | %s", tokens[j]); 54 | fprintf(f, "\r\n"); 55 | } 56 | 57 | fprintf(f, "\r\n"); 58 | fprintf(f, "Total libraries: %d\r\n", listlen); 59 | fprintf(f, "Total lines of C code: %d\r\n\r\n", total_lines); 60 | 61 | fwrite(footer, 1, flen, f); 62 | fclose(f); 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /tools/make_readme.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="make_readme" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=make_readme - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "make_readme.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "make_readme.mak" CFG="make_readme - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "make_readme - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "make_readme - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "make_readme - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "make_readme - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug\make_readme" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 68 | # SUBTRACT CPP /YX 69 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 70 | # ADD RSC /l 0x409 /d "_DEBUG" 71 | BSC32=bscmake.exe 72 | # ADD BASE BSC32 /nologo 73 | # ADD BSC32 /nologo 74 | LINK32=link.exe 75 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | 78 | !ENDIF 79 | 80 | # Begin Target 81 | 82 | # Name "make_readme - Win32 Release" 83 | # Name "make_readme - Win32 Debug" 84 | # Begin Source File 85 | 86 | SOURCE=.\make_readme.c 87 | # End Source File 88 | # Begin Source File 89 | 90 | SOURCE=.\README.header.md 91 | # End Source File 92 | # Begin Source File 93 | 94 | SOURCE=.\README.list 95 | # End Source File 96 | # End Target 97 | # End Project 98 | -------------------------------------------------------------------------------- /tools/mr.bat: -------------------------------------------------------------------------------- 1 | debug\make_readme 2 | -------------------------------------------------------------------------------- /tools/trailing_whitespace.c: -------------------------------------------------------------------------------- 1 | #define STB_DEFINE 2 | #include "stb.h" 3 | 4 | int main(int argc, char **argv) 5 | { 6 | int i; 7 | for (i=1; i < argc; ++i) { 8 | int len; 9 | FILE *f; 10 | char *s = stb_file(argv[i], &len); 11 | char *end, *src, *dest; 12 | if (s == NULL) { 13 | printf("Couldn't read file '%s'.\n", argv[i]); 14 | continue; 15 | } 16 | end = s + len; 17 | src = dest = s; 18 | while (src < end) { 19 | char *start=0; 20 | while (src < end && *src != '\n' && *src != '\r') 21 | *dest++ = *src++; 22 | while (dest-1 > s && (dest[-1] == ' ' || dest[-1] == '\t')) 23 | --dest; 24 | while (src < end && (*src == '\n' || *src == '\r')) 25 | *dest++ = *src++; 26 | } 27 | f = fopen(argv[i], "wb"); 28 | fwrite(s, 1, dest-s, f); 29 | fclose(f); 30 | } 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /tools/unicode/unicode.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="unicode" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=unicode - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "unicode.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "unicode.mak" CFG="unicode - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "unicode - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "unicode - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "unicode - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "unicode - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 69 | # ADD RSC /l 0x409 /d "_DEBUG" 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LINK32=link.exe 74 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 75 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "unicode - Win32 Release" 82 | # Name "unicode - Win32 Debug" 83 | # Begin Source File 84 | 85 | SOURCE=..\unicode.c 86 | # End Source File 87 | # End Target 88 | # End Project 89 | --------------------------------------------------------------------------------