mirror of
https://github.com/storytold/craft-libs.git
synced 2026-12-01 02:36:54 +01:00
texture: say that 64-bit TIFF floats are narrowed to f32
The README and the decode module docs said float samples are kept as stored. The TIFF codec narrows 64-bit float samples to f32, so both now name that exception.
This commit is contained in:
1 parent
7ea59fff8b
commit
3aa852b092
2 files changed
+4
-2
No files matched your search
@@ -62,7 +62,8 @@ network I/O and has no `unsafe` code.
|
||||
`decode::hdr` and `decode::exr` turn a file's bytes into a plane. Integer samples are divided
|
||||
by their maximum (255 or 65535), so a 16-bit file keeps all 65536 levels. Float samples are
|
||||
kept as stored, values above 1 and negative values included, and OpenEXR NaN and infinities
|
||||
too. Gray without alpha gives a gray plane, as does an OpenEXR file of exactly one channel
|
||||
too, except that 64-bit TIFF floats are narrowed to 32 bits and lose any precision beyond
|
||||
`f32`. Gray without alpha gives a gray plane, as does an OpenEXR file of exactly one channel
|
||||
whatever its name; every other layout gives RGBA, with alpha 1 when the file has none. The
|
||||
result's `transfer` is `Encoded` for integer code values whose transfer
|
||||
the file does not state, `Linear` for Radiance HDR, OpenEXR and PNG with a linear `cICP`, and
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! Decoding PNG, TIFF, Radiance HDR and OpenEXR bytes into float [`Image`] planes, each format
|
||||
//! behind its own Cargo feature. Integer samples are scaled by their own maximum (255 for 8 bits,
|
||||
//! 65535 for 16 bits), so a 16-bit file keeps all 65536 levels. Float samples are kept as stored:
|
||||
//! values above 1, negative values and, in OpenEXR, NaN and infinities.
|
||||
//! values above 1, negative values and, in OpenEXR, NaN and infinities. The one exception is a
|
||||
//! 64-bit TIFF float, which is narrowed to `f32` and loses any precision beyond it.
|
||||
//!
|
||||
//! Every function takes the file's bytes and does no I/O. The size of the result is checked
|
||||
//! against [`Limits`] before its plane is reserved, and the reservation is fallible. The format
|
||||
|
||||
Reference in new issue
Block a user