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
| Name | Description |
|---|---|
| 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.csInitializes 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
isXyzbool- Whether the samples are CIE XYZ (
FORMAT=32-bit_rle_xyze) rather than RGB. exposuredouble- The product of the
EXPOSUREvariables, 1 without any. colorCorrectionIReadOnlyList<double>- The products of the three terms of the
COLORCORRvariables, (1, 1, 1) without any. primariesIReadOnlyList<double>?- The eight chromaticities of the
PRIMARIESvariable, ornullwithout it. pixelAspectRatiodouble- The product of the
PIXASPECTvariables, 1 without any. gammadouble?- The value of the
GAMMAvariable, ornullwithout it. viewstring?- The
VIEWvariables, joined with a space, ornullwithout any. softwarestring?- The value of the
SOFTWAREvariable, ornullwithout it. scanOrderstring- The orientation of the resolution string, such as
-Y +X.
Exceptions
ArgumentNullExceptioncolorCorrectionorscanOrderisnull.ArgumentExceptioncolorCorrectiondoes not have three terms,primariesdoes not have eight, orscanOrderis not one of the eight orientations.
Properties
| Name | Description |
|---|---|
| ColorCorrection | Gets the products of the red, green and blue terms of the COLORCORR variables ((1, 1, 1) without any). |
| Exposure | Gets the product of the EXPOSURE variables: the multiplier that was applied to the pixels (1 without any). |
| Gamma | Gets the value of the GAMMA variable, or null without it. It is never applied. |
| IsXyz | Gets a value indicating whether the samples of the file are CIE XYZ (32-bit_rle_xyze) rather than RGB (32-bit_rle_rgbe). |
| PixelAspectRatio | Gets the product of the PIXASPECT variables: the height of a pixel divided by its width (1 without any). |
| Primaries | 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). |
| ScanOrder | 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. |
| Software | Gets the value of the SOFTWARE variable, or null without it. |
| View | Gets the view parameters of the VIEW variables, joined with a space, or null without any. |
ColorCorrection
RadianceHeader.csGets 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
Exposure
RadianceHeader.csGamma
RadianceHeader.csIsXyz
RadianceHeader.csPixelAspectRatio
RadianceHeader.csPrimaries
RadianceHeader.csGets 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; }Property value
ScanOrder
RadianceHeader.csGets 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
Software
RadianceHeader.csMethods
| Name | Description |
|---|---|
| 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.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(RadianceHeader? other)Parameters
otherRadianceHeader?- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.