Skip to content
FutureBlitz

    Install

    Import std.image.hdr

    Hdr

    std.image.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)

    std/image/hdr.fb, line 197

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): HdrImage Throws IOError static method #

      The image in data, Radiance's RGBE, each pixel opaque. Throws an IOError of INVALID_DATA when the data isn't an HDR image or is broken, and OTHER when the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: HdrImage): UInt8[] static method #

      The image in 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.