Struct GainMapValues
A value for each of red, green and blue; a one-channel gain map has the same three.
public readonly record struct GainMapValues : IEquatable<GainMapValues>
- Implements
- Inherited Members
Examples
// As stored: the SDR base image, with the gain map in the metadata.
using Raster sdr = Raster.Load("ultrahdr.jpg");
GainMap? map = sdr.Metadata.GainMap; // null for a plain JPEG
// The HDR rendition for a display 4x as bright as SDR white: linear half floats, 1.0 = SDR white.
using Raster<RgbaF16> hdr = Raster.Load<RgbaF16>("ultrahdr.jpg", options: new ReaderOptions { Hdr = new HdrDecode { Headroom = 4 } });
// The same from a raster in hand, at the map's full capacity.
using Raster<RgbaF16> full = map!.Apply(sdr);
Constructors
GainMapValues(double)
Initializes the same value for all three.
public GainMapValues(double all)
Parameters
alldoubleThe value.
GainMapValues(double, double, double)
A value for each of red, green and blue; a one-channel gain map has the same three.
public GainMapValues(double Red, double Green, double Blue)
Parameters
Examples
// As stored: the SDR base image, with the gain map in the metadata.
using Raster sdr = Raster.Load("ultrahdr.jpg");
GainMap? map = sdr.Metadata.GainMap; // null for a plain JPEG
// The HDR rendition for a display 4x as bright as SDR white: linear half floats, 1.0 = SDR white.
using Raster<RgbaF16> hdr = Raster.Load<RgbaF16>("ultrahdr.jpg", options: new ReaderOptions { Hdr = new HdrDecode { Headroom = 4 } });
// The same from a raster in hand, at the map's full capacity.
using Raster<RgbaF16> full = map!.Apply(sdr);
Properties
Blue
The blue value.
public double Blue { get; init; }
Property Value
Green
The green value.
public double Green { get; init; }
Property Value
IsUniform
Gets whether the three are equal.
public bool IsUniform { get; }
Property Value
this[int]
Gets the value of channel 0, 1 or 2.
public double this[int channel] { get; }
Parameters
channelint0 for red, 1 for green, 2 for blue.
Property Value
Red
The red value.
public double Red { get; init; }