RadianceHeader Class

The immutable variables of the information header of a Radiance HDR file, and the order of its scanlines. This is informational only, like ImageMetadata.SourceFormat: it describes the file, not the pixels.

public sealed class RadianceHeader : IEquatable<RadianceHeader>

Remarks

Nothing is applied to the pixels: they are the values the file stores. The radiances the picture had before it was adjusted are the pixels divided by RadianceHeader.Exposure, and each color divided by its color correction too.

No operation updates it, and every encoder ignores it: RadianceEncoder writes no exposure and no color correction, since the pixels it writes are the values it is given.

Implements

Constructors

NameDescription
RadianceHeader(bool, double, IReadOnlyList<double>, IReadOnlyList<double>?, double, double?, string?, string?, string)Initializes a new instance of the RadianceHeader class.

RadianceHeader(bool, double, IReadOnlyList<double>, IReadOnlyList<double>?, double, double?, string?, string?, string)

RadianceHeader.cs

Initializes a new instance of the RadianceHeader class.

public RadianceHeader(bool isXyz, double exposure, IReadOnlyList<double> colorCorrection, IReadOnlyList<double>? primaries, double pixelAspectRatio, double? gamma, string? view, string? software, string scanOrder)

Parameters

isXyz bool
Whether the samples are CIE XYZ (FORMAT=32-bit_rle_xyze) rather than RGB.
exposure double
The product of the EXPOSURE variables, 1 without any.
colorCorrection IReadOnlyList<double>
The products of the three terms of the COLORCORR variables, (1, 1, 1) without any.
primaries IReadOnlyList<double>?
The eight chromaticities of the PRIMARIES variable, or null without it.
pixelAspectRatio double
The product of the PIXASPECT variables, 1 without any.
gamma double?
The value of the GAMMA variable, or null without it.
view string?
The VIEW variables, joined with a space, or null without any.
software string?
The value of the SOFTWARE variable, or null without it.
scanOrder string
The orientation of the resolution string, such as -Y +X.

Exceptions

ArgumentNullException
colorCorrection or scanOrder is null.
ArgumentException
colorCorrection does not have three terms, primaries does not have eight, or scanOrder is not one of the eight orientations.

Properties

NameDescription
ColorCorrectionGets the products of the red, green and blue terms of the COLORCORR variables ((1, 1, 1) without any).
ExposureGets the product of the EXPOSURE variables: the multiplier that was applied to the pixels (1 without any).
GammaGets the value of the GAMMA variable, or null without it. It is never applied.
IsXyzGets a value indicating whether the samples of the file are CIE XYZ (32-bit_rle_xyze) rather than RGB (32-bit_rle_rgbe).
PixelAspectRatioGets the product of the PIXASPECT variables: the height of a pixel divided by its width (1 without any).
PrimariesGets the CIE (x, y) chromaticities of the red, green and blue primaries and of the white point of the PRIMARIES variable, or null without it (the standard primaries of Radiance).
ScanOrderGets the orientation of the resolution string of the file, without its sizes: -Y +X for scanlines that are rows stored from the top, left to right (the standard order), or one of the seven other orders (-Y -X, +Y -X, +Y +X, +X +Y, -X +Y, -X -Y, +X -Y). The decoded image is always in the standard orientation.
SoftwareGets the value of the SOFTWARE variable, or null without it.
ViewGets the view parameters of the VIEW variables, joined with a space, or null without any.

ColorCorrection

RadianceHeader.cs

Gets the products of the red, green and blue terms of the COLORCORR variables ((1, 1, 1) without any).

public IReadOnlyList<double> ColorCorrection { get; }

Property value

IReadOnlyList<double>

Gets the product of the EXPOSURE variables: the multiplier that was applied to the pixels (1 without any).

public double Exposure { get; }

Property value

double

Gets the value of the GAMMA variable, or null without it. It is never applied.

public double? Gamma { get; }

Property value

double?

Gets a value indicating whether the samples of the file are CIE XYZ (32-bit_rle_xyze) rather than RGB (32-bit_rle_rgbe).

public bool IsXyz { get; }

Property value

bool

PixelAspectRatio

RadianceHeader.cs

Gets the product of the PIXASPECT variables: the height of a pixel divided by its width (1 without any).

public double PixelAspectRatio { get; }

Property value

double

Gets the CIE (x, y) chromaticities of the red, green and blue primaries and of the white point of the PRIMARIES variable, or null without it (the standard primaries of Radiance).

public IReadOnlyList<double>? Primaries { get; }

Gets the orientation of the resolution string of the file, without its sizes: -Y +X for scanlines that are rows stored from the top, left to right (the standard order), or one of the seven other orders (-Y -X, +Y -X, +Y +X, +X +Y, -X +Y, -X -Y, +X -Y). The decoded image is always in the standard orientation.

public string ScanOrder { get; }

Property value

string

Gets the value of the SOFTWARE variable, or null without it.

public string? Software { get; }

Property value

string?

Gets the view parameters of the VIEW variables, joined with a space, or null without any.

public string? View { get; }

Property value

string?

Methods

NameDescription
Equals(RadianceHeader?)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Determines whether the specified object is equal to the current object.
GetHashCode()Serves as the default hash function.
ToString()Returns a string that represents the current object.

Equals overloads

Equals(RadianceHeader?)

RadianceHeader.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(RadianceHeader? other)
Parameters
other RadianceHeader?
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

RadianceHeader.cs

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current object.
Returns

bool true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

RadianceHeader.cs

Serves as the default hash function.

public override int GetHashCode()

Returns

int A hash code for the current object.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.