OpenExrDecodingOptions Class
Immutable options of the OpenEXR decoder (ImageConfiguration.OpenExrDecoding): the channels it decodes and the window the image covers.
public sealed class OpenExrDecodingOptionsRemarks
They apply to every operation that reads an OpenEXR file: identification, eager loads, sequential readers and collections, which report and decode the same image. The defaults read only the files whose every channel and every stored pixel is part of the image, and reject the others with an UnsupportedImageFeatureException.
A channel belongs to the layer named by its name up to its last dot: diffuse.R is the red channel of the layer diffuse, and R the red channel of the default layer, whose name is empty. A layer is decoded from its R, G, B and A channels, any of them (a missing color is 0, a missing alpha is 1), or from its Y (luminance) and A channels.
Constructors
| Name | Description |
|---|---|
| OpenExrDecodingOptions() |
OpenExrDecodingOptions()
public OpenExrDecodingOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Default | Gets the default options: every channel decoded, and the display window as the image. |
| Layer | Gets the layer that is decoded, or null (the default) to decode every channel of the file. Use String.Empty for the default layer (the channels R, G, B, A and Y without prefix). |
| WindowMode | Gets the window the image covers. Defaults to OpenExrWindowMode.DisplayWindow. |
Default
OpenExrDecodingOptions.csGets the default options: every channel decoded, and the display window as the image.
public static OpenExrDecodingOptions Default { get; }Property value
Gets the layer that is decoded, or null (the default) to decode every channel of the file. Use String.Empty for the default layer (the channels R, G, B, A and Y without prefix).
public string? Layer { get; init; }Property value
Remarks
With null, every channel must be one of R, G, B, A and Y: a file with other channels (depth, layers, other outputs of a renderer) is rejected, since they would be lost.
With a layer, the channels of the layer are decoded and the other channels of the file are ignored: Z, the channels of the other layers, and the channels of the layer that are not colors. A layer that has no color channel (none of R, G, B and Y), that has both RGB channels and a luminance channel, that has chroma channels (RY, BY), or whose Y channel comes with an X channel (the components of a vector such as N.X, N.Y, N.Z, or CIE XYZ colors) is rejected with an UnsupportedImageFeatureException; the message of a missing layer lists the layers of the file that have colors: the decoder never guesses another layer.
WindowMode
OpenExrDecodingOptions.csGets the window the image covers. Defaults to OpenExrWindowMode.DisplayWindow.
public OpenExrWindowMode WindowMode { get; init; }Property value
Exceptions
ArgumentOutOfRangeException- The value is not a defined
OpenExrWindowMode.
Remarks
With OpenExrWindowMode.CropToDisplayWindow and OpenExrWindowMode.DataWindow, the data window counts against the size limits too (ImageResourceLimits.MaxWidth, ImageResourceLimits.MaxHeight and ImageResourceLimits.MaxFramePixels), since every chunk of it is decoded.