Crate rgbe

source ·
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§