Enum RadiancePixelFormat
What a Radiance file's four bytes a pixel hold.
public enum RadiancePixelFormat
Fields
Rgbe = 0Red, green and blue mantissas with a shared exponent (FORMAT=32-bit_rle_rgbe).
Xyze = 1CIE X, Y and Z mantissas with a shared exponent (FORMAT=32-bit_rle_xyze). Egami converts them to RGB on load.
Examples
// Linear light, unclamped: 1.0 is reference white. The brightest value is measured as the light level ToneMap fits.
using Raster<RgbF32> hdr = Raster.Load<RgbF32>("desk.hdr");
var details = (RadianceDetails)hdr.Metadata.FormatDetails!;
double? exposure = details.Exposure; // the header's EXPOSURE lines; the pixels are kept as stored
// To SDR: tone map, then save. Saving the HDR raster to PNG or JPEG as it is would clip the highlights.
using Raster<RgbF32> mapped = hdr.Derive(ops => ops.ToneMap(ToneMapping.Bt2390));
mapped.Save("desk.jpg");
// RGBE with per-channel run-length scanlines, as Radiance writes them; EXPOSURE only when asked for.
hdr.Save("copy.hdr");
hdr.Save("labeled.hdr", new RadianceWriterOptions { Exposure = 1.5 });