GainMapChannel Class
The parameters of one channel of a gain map (ISO 21496-1, the hdrgm XMP namespace of Adobe and Ultra HDR): how the samples of the gain map image become the gain that turns the base image into the alternate image.
public sealed class GainMapChannel : IEquatable<GainMapChannel>Remarks
For a sample g of the gain map in [0, 1], the gain in stops is lerp(GainMapMin, GainMapMax, pow(g, 1 / Gamma)), and an alternate color is (base + BaseOffset) * exp2(gain * weight) - AlternateOffset in linear light, where the weight depends on the headroom of the display (GainMapMetadata.GetWeight).
- Implements
Constructors
| Name | Description |
|---|---|
| GainMapChannel(double, double, double, double, double) | Initializes a new instance of the GainMapChannel class. |
GainMapChannel(double, double, double, double, double)
GainMapChannel.csInitializes a new instance of the GainMapChannel class.
public GainMapChannel(double gainMapMin, double gainMapMax, double gamma, double baseOffset, double alternateOffset)Parameters
gainMapMindouble- The gain of a sample of 0, in stops (log2 of the ratio of the alternate color to the base color).
gainMapMaxdouble- The gain of a sample of 1, in stops; at least
gainMapMin. gammadouble- The exponent the samples were encoded with; greater than 0.
baseOffsetdouble- The offset added to the linear base color before the gain applies.
alternateOffsetdouble- The offset subtracted from the color once the gain applied.
Exceptions
ArgumentOutOfRangeException- A value is not finite,
gammais not greater than 0, orgainMapMaxis less thangainMapMin.
Properties
| Name | Description |
|---|---|
| AlternateOffset | Gets the offset subtracted from the color once the gain applied. |
| BaseOffset | Gets the offset added to the linear base color before the gain applies. |
| GainMapMax | Gets the gain of a sample of 1, in stops. |
| GainMapMin | Gets the gain of a sample of 0, in stops (log2 of the ratio of the alternate color to the base color). |
| Gamma | Gets the exponent the samples were encoded with. |
AlternateOffset
GainMapChannel.csBaseOffset
GainMapChannel.csGainMapMax
GainMapChannel.csGainMapMin
GainMapChannel.csGamma
GainMapChannel.csMethods
| Name | Description |
|---|---|
| Equals(GainMapChannel?) | 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(GainMapChannel?)
GainMapChannel.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(GainMapChannel? other)Parameters
otherGainMapChannel?- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.