Table of Contents

Class ExrChannel

Namespace
Egami.Formats.Exr
Assembly
Egami.dll

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

Name string

The full name, such as "R", "diffuse.R" or "Z".

PixelType ExrPixelType

The sample type.

XSampling int

Samples are stored for every x that is a multiple of this; 1 for full resolution.

YSampling int

Samples are stored for every y that is a multiple of this; 1 for full resolution.

PerceptuallyLinear bool

Whether 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

string

PerceptuallyLinear

Whether the channel holds perceptually linear values, which lossy compressions treat differently.

public bool PerceptuallyLinear { get; init; }

Property Value

bool

PixelType

The sample type.

public ExrPixelType PixelType { get; init; }

Property Value

ExrPixelType

XSampling

Samples are stored for every x that is a multiple of this; 1 for full resolution.

public int XSampling { get; init; }

Property Value

int

YSampling

Samples are stored for every y that is a multiple of this; 1 for full resolution.

public int YSampling { get; init; }

Property Value

int