Table of Contents

Struct GainMapValues

Namespace
Egami.Colors
Assembly
Egami.dll

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

all double

The 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

Red double

The red value.

Green double

The green value.

Blue double

The blue value.

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

double

Green

The green value.

public double Green { get; init; }

Property Value

double

IsUniform

Gets whether the three are equal.

public bool IsUniform { get; }

Property Value

bool

this[int]

Gets the value of channel 0, 1 or 2.

public double this[int channel] { get; }

Parameters

channel int

0 for red, 1 for green, 2 for blue.

Property Value

double

Red

The red value.

public double Red { get; init; }

Property Value

double