Set craft_hdr::Limits::max_axis from Limits::max_side and drop the
separate resolution-line parser. A side over the limit is now
DecodeError::LimitExceeded ("axis length"), reported before any pixel
memory is allocated.
The comparisons with craft-cms, craft-mesh and craft-psd and their
dev-dependencies are removed. The tests of the pair against
IEC 61966-2-1 move to tests/it/srgb.rs, linked through tests/it/main.rs.
`decode::exr` now refuses a file when any part is deep, not only when the
picked color part is, as its documentation says. A file with a flat RGB
part beside a deep part decoded before.
`hdr_size` now treats a line of carriage returns alone as the empty line
that ends a Radiance header, as `craft_hdr::decode` does. A header ending
in `\r\r\n` skipped the side check before the decoder ran.
worst() now asserts that each difference is finite and names the code it
is at. Before, a NaN difference never replaced the maximum, so a pair that
returned NaN at every code passed the tolerance checks. A new test checks
that worst() fails on a NaN difference.
New optional features png, tiff, hdr and exr (decode enables all four) add
the decode module. decode::png and decode::tiff read through
craft-image-codecs at the stored sample depth, so 16-bit samples become
v / 65535 and keep all 65536 levels instead of passing through 8 bits.
decode::hdr reads through craft-hdr and decode::exr through craft-exr;
values above 1, negative values and OpenEXR NaN and infinities are kept.
Each result carries a transfer tag (Encoded, Linear or Unknown, from the
PNG cICP chunk, an ICC profile or the format) and an alpha tag (OpenEXR is
premultiplied, TIFF associated alpha is converted to straight). No
transfer function is applied.
The plane is checked against Limits before it is reserved, with one
fallible allocation. The format decoders get the same side, pixel and byte
limits; a Radiance HDR side over max_side is refused from the header, and
OpenEXR counts every declared channel toward max_bytes. A TIFF whose image
data ends early, CMYK and Lab TIFF, and OpenEXR files with a deep part are
errors. The decoding features build for wasm32-unknown-unknown.
The new tests in crates/texture/tests/srgb.rs compare linear_to_srgb and
srgb_to_linear with the IEC 61966-2-1 formulas at every 8-bit and 16-bit
code, check both thresholds (0.0031308 and 0.04045) and their neighbors,
round trips, and that the outputs do not decrease over the code grids.
They pin the behavior outside [0, 1]: negative values stay on the linear
segment, values above 1 follow the power segment, infinities keep their
sign and NaN stays NaN.
craft-mesh's pair and craft-psd's float::srgb_encode must match bit for
bit, and craft-cms's srgb_trc() curve within 2.4e-7. craft-cms,
craft-mesh and craft-psd are dev-dependencies of craft-texture.