Class ExrChannel
One channel of an OpenEXR part.
public sealed record ExrChannel : IEquatable<ExrChannel>
- Inheritance
-
ExrChannel
- Implements
- Inherited Members
Examples
// The first part's RGBA channels as linear light, 1.0 reference white; other layers by name.
using Raster<RgbaF32> beauty = Raster.Load<RgbaF32>("render.exr");
var details = (ExrDetails)beauty.Metadata.FormatDetails!;
IReadOnlyList<string> layers = details.Parts[details.Part].Layers; // "diffuse", "specular"
using Raster<RgbaF32> diffuse = Raster.Load<RgbaF32>("render.exr", options: new ExrReaderOptions { Layer = "diffuse" });
// Any one channel, such as depth or an object id, as 32-bit float.
using Raster<GrayF32> depth = ExrImage.ReadChannel("aov.exr", "Z");
Constructors
ExrChannel(string, ExrPixelType, int, int, bool)
One channel of an OpenEXR part.
public ExrChannel(string Name, ExrPixelType PixelType, int XSampling = 1, int YSampling = 1, bool PerceptuallyLinear = false)
Parameters
NamestringThe full name, such as "R", "diffuse.R" or "Z".
PixelTypeExrPixelTypeThe sample type.
XSamplingintSamples are stored for every x that is a multiple of this; 1 for full resolution.
YSamplingintSamples are stored for every y that is a multiple of this; 1 for full resolution.
PerceptuallyLinearboolWhether the channel holds perceptually linear values, which lossy compressions treat differently.
Examples
// The first part's RGBA channels as linear light, 1.0 reference white; other layers by name.
using Raster<RgbaF32> beauty = Raster.Load<RgbaF32>("render.exr");
var details = (ExrDetails)beauty.Metadata.FormatDetails!;
IReadOnlyList<string> layers = details.Parts[details.Part].Layers; // "diffuse", "specular"
using Raster<RgbaF32> diffuse = Raster.Load<RgbaF32>("render.exr", options: new ExrReaderOptions { Layer = "diffuse" });
// Any one channel, such as depth or an object id, as 32-bit float.
using Raster<GrayF32> depth = ExrImage.ReadChannel("aov.exr", "Z");
Properties
Name
The full name, such as "R", "diffuse.R" or "Z".
public string Name { get; init; }
Property Value
PerceptuallyLinear
Whether the channel holds perceptually linear values, which lossy compressions treat differently.
public bool PerceptuallyLinear { get; init; }
Property Value
PixelType
The sample type.
public ExrPixelType PixelType { get; init; }
Property Value
XSampling
Samples are stored for every x that is a multiple of this; 1 for full resolution.
public int XSampling { get; init; }
Property Value
YSampling
Samples are stored for every y that is a multiple of this; 1 for full resolution.
public int YSampling { get; init; }