Import std.image.hdr
Hdr
struct
Public Struct Hdr
What reads and writes Radiance's RGBE files, in its Static Methods.
Examples
Local light = HdrImage(1, 1)
light[0, 0] = Color(2, 1, 0.5, 1)
Local back = Try Hdr.Decode(Hdr.Encode(light))
Expect(back[0, 0].r == 2.0 && back[0, 0].g == 1.0)-
@PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): HdrImage Throws IOErrorstatic method #The image in
data, Radiance's RGBE, each pixel opaque. Throws an IOError of INVALID_DATA when thedataisn't an HDR image or is broken, and OTHER when the image has more pixels thanlimit. Panics when thelimitis negative. -
The
imagein Radiance's RGBE, run-length encoded, without its alpha: a channel that's negative or NaN is 0, and one past the most RGBE holds, 255 times 2^119, about 1.69e38, is that most. Panics when it has no pixels.
Report an issue with this page or with FutureBlitz on GitHub.