Skip to content

v0.0.10

Choose a tag to compare

@fluxin fluxin released this 21 Oct 02:29
· 40 commits to main since this release

Radiance HDR (asked for by o3d, for environment maps that 8-bit images clip). image/hdr decodes .hdr (RGBE) to linear RGBA f32 with alpha 1, rows top-down.

  • Facade: image.info reports Format.HDR with the width and height. image.decode_float_into(data, pixels: []f32) fills width * height * 4 floats the caller owns.
  • The RGBA8 decode and decode_into return .Unsupported for HDR rather than tone-mapping it.
  • Reads: the #?RADIANCE and #?RGBE signatures, FORMAT=32-bit_rle_rgbe, the standard -Y height +X width orientation, and RLE or flat scanlines.
  • Not supported, as in stb: XYZE files and the other orientations return .Unsupported. Old-style RLE is read as plain pixels.
  • Exact: f32 holds every RGBE value exactly, and the output is bit-identical to stb_image's stbi_loadf on ImageMagick and ffmpeg files (RLE, flat, 5 and 32768 pixels wide, #?RGBE) and on two real environment maps. It is 1.5 to 10 times faster.
  • Memory: the decode allocates nothing beyond the caller's buffer, because RLE scanlines expand inside the caller's own row. info refuses a file too short for the size it claims, so a corrupt header can't make a caller allocate gigabytes.

Also removes the empty audio/reader.odin.new that v0.0.9 shipped by mistake (reported by ottis).

Import paths are unchanged from v0.0.9. The image gate (with the new HDR comparison and fuzz), every package's check under vet, and every package's tests pass.