Files
sx/library/vendors/stb_image/README.md
agra 58af806b7a library: vendors/stb_image + vendors/stb_truetype — stb ships with sx
The stb headers move from the repo-root vendors/ (resolvable only
with CWD = sx repo) into library/vendors/ following the sqlite
convention — bindings module + c/ sources + provenance README — so
'#import "vendors/stb_image/stb_image.sx"' (image v2.30 + image_write
v1.16) and '#import "vendors/stb_truetype/stb_truetype.sx"' (v1.26)
work from any consumer via the stdlib search paths. modules/ffi/stb.sx
dissolves into the stb_image vendor; modules/ffi/stb_truetype.sx keeps
its non-stb text-shaping companions and re-imports the vendored unit.
examples/1625 pins a deterministic in-memory BMP decode; examples/1626
pins font init + metric invariants against the system Helvetica.
2026-06-12 17:50:21 +03:00

21 lines
1012 B
Markdown

# vendors/stb_image — image decode/encode for sx programs
- stb_image: **v2.30**; stb_image_write: **v1.16** (version comments at
the top of each header)
- Source: <https://github.com/nothings/stb> (`stb_image.h`,
`stb_image_write.h`)
- License: public domain / MIT, dual (see the headers' license blocks)
- Files: `c/stb_image.h` + `c/stb_image_impl.c`, `c/stb_image_write.h`
+ `c/stb_image_write_impl.c` (each impl .c defines the
`*_IMPLEMENTATION` macro and includes its header)
`#import "vendors/stb_image/stb_image.sx"` resolves through the stdlib
search paths; the decls (`stbi_load`, `stbi_load_from_memory`,
`stbi_image_free`, `stbi_write_png`, …) are synthesized from the
headers, and the implementation compiles once per machine through sx's
object cache. `examples/1625-vendor-stb-image-decode.sx` pins an
in-memory BMP decode in the sx suite.
To upgrade: replace the headers under `c/` with newer upstream copies,
update this file, and rebuild (the object cache keys on source bytes).