Expand description
A library for loading and handling RGBE-format HDR textures.
Provides types for handling common-exponent floating point texture formats as well as conversions between them and independent floating-point channels. Supports the RGBE8 format which is storable in Radiance HDR and PNG files, as well as the RGB9E5 GPU texture format.
An intended use case for this library is to store HDR textures as RGBE8 PNG files and convert them to RGB9E5 for the GPU when loading.
Radiance HDR images can be converted to RGBE8 PNG files on the command line using
the included hdr2rgbe-png
tool.
Structs§
- Aligned epresentation of
rgb9e5ufloat
texel. Field order (from LSB to MSB) is 9 bits each of subnormal R, G, and B mantissa then 5 bits of a common exponent. - Aligned representation of
rgba16float
texel. This is a common render format for HDR images when creating or processing assets before conversion to a GPU-read-only RGBE format. - Aligned representation of Radiance RGBE8 pixel. r, g, and b are subnormal mantissas and e (taking the place of the alpha channel) is a common exponent. This is commonly loaded from Radiance pictures (.hdr).
Functions§
- Reads the data from an HdrDecoder as a slice of RGBE8 texels.
- Reads the and converts data from an HdrDecoder as a slice of RGB9E5 texels.
- Reads the data from an PngDecoder as a slice of RGBE8 texels.
- Reads the and converts data from an PngDecoder as a slice of RGB9E5 texels.
- Encodes RGBE8 texel data into RGBA8 PNG format, storing the exponent in the alpha channel.
- Loads a radiance file, returning the dimensions and a slice of RGBE8 texel data.
- Loads an RGBE8-format PNG file, returning the dimensions and a slice of the pixel data.
- Loads an RGBE8-format PNG file, returning the dimensions and a slice of the pixel data converted to RGB9E5 format. This is intended for loading HDR textures to use on the GPU.
- Saves RGBE8 texel data into RGBA8 PNG file, storing the exponent in the alpha channel. This package also exports a command-line tool (hdr2rgbe-png) for converting Radiance HDR images to RGBE8-PNG.