tests/image: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:18 -05:00
1 parent e306d5c1d7
commit a80299dce0
27 files changed
+32 -199

No files matched your search

+1 -7
View File
@@ -1,7 +1,4 @@
-- image/hdr tests: ImageMagick-written Radiance files (new-style RLE) against its float decodes, hand-written ones
-- (flat and old-style RLE scanlines, "#?RGBE", EXPOSURE products, all orientations) against the rgbe.c rule; the
-- display conversion to rgba8; our encoder round-trips (RLE and flat, rgbaf32 and rgba8) within RGBE precision;
-- errors; the fuzz no-throw pass. Fixtures: tools/fixtures/hdr.py.
-- image/hdr tests against ImageMagick's float decodes and the rgbe.c rule (tools/fixtures/hdr.py).
local T = require("@tests/T")
local Hdr = require("@rosetta/image/hdr")
local Bytes = require("@rosetta/core/Bytes")
@@ -18,7 +15,6 @@ local function dec(data: any, opts: any?): (any, any)
return Hdr.decode(Bytes.reader(if type(data) == "string" then buffer.fromstring(data) else data), opts)
end
-- worst relative error between two rgbaf32 buffers
local function relErr(a: buffer, b: buffer, n: number): number
local worst = 0
for i = 0, n * 4 - 1 do
@@ -40,7 +36,6 @@ for _, c in Fx do
if c.exposure then
t:check(math.abs(img.meta.exposure - c.exposure) < 1e-9, c.name .. ": exposure")
end
-- the default rgba8 display conversion
local d8 = dec(c.data)
t:eq(d8.format, "rgba8", c.name .. ": rgba8 by default")
local v = buffer.readf32(img.pixels, 0)
@@ -77,7 +72,6 @@ do
end
end
t:check(worst < 1 / 128, "float precision " .. worst)
-- rgba8 in, rgba8 out
local i8 = Types.Image.new(9, 2)
for i = 0, 17 do
buffer.writeu32(i8.pixels, i * 4, 0xFF000000 + (i * 14) * 0x10101)