GainMap Class

A gain map to write next to an image (JpegEncoder.GainMap, AvifEncoder.GainMap): the image whose samples give the gain, and the parameters that turn them into the gain (ISO 21496-1).

public sealed class GainMap

Remarks

The samples of GainMap.Image are the coded values of the gain map, as AuxiliaryImage.Decode returns them: a grayscale image gives one gain for the three channels. It may be smaller than the base image, which readers then cover by interpolation. Its color description (ICC profile, CICP) is the color space of the alternate rendition, which a gain map that does not use the color space of the base image applies in (GainMapMetadata.UseBaseColorSpace).

The image is borrowed, not copied: it must stay alive, and unchanged, until the encoder has written the file.

Constructors

NameDescription
GainMap(Image, GainMapMetadata)Initializes a new instance of the GainMap class.

GainMap(Image, GainMapMetadata)

GainMap.cs

Initializes a new instance of the GainMap class.

public GainMap(Image image, GainMapMetadata metadata)

Parameters

image Image
The gain map image: one frame, its samples the coded values of the gain map.
metadata GainMapMetadata
The parameters of the gain map.

Exceptions

ArgumentNullException
image or metadata is null.

Properties

NameDescription
ImageGets the gain map image.
MetadataGets the parameters of the gain map.

Gets the gain map image.

public Image Image { get; }

Property value

Image

Metadata

GainMap.cs

Gets the parameters of the gain map.

public GainMapMetadata Metadata { get; }

Property value

GainMapMetadata