Table of Contents

Class JxlExtraChannel

Namespace
Egami.Formats.Jxl
Assembly
Egami.dll

One extra channel of a JPEG XL image, listed in ExtraChannels.

public sealed class JxlExtraChannel
Inheritance
JxlExtraChannel
Inherited Members

Examples

// Alpha joins the pixels (straight, even when the file premultiplies); other extra channels are listed in the details.
using Raster image = Raster.Load("sprite.jxl");
JxlDetails details = (JxlDetails)image.Metadata.FormatDetails!;
foreach (JxlExtraChannel channel in details.ExtraChannels)
{
    Console.WriteLine($"{channel.Kind} '{channel.Name}', {channel.BitsPerSample} bits");
}

// Any one of them alone, such as depth or a selection mask, as gray floats.
using Raster<GrayF32> alpha = JxlImage.ReadExtraChannel("sprite.jxl", 0);

// Spot colors are mixed into the color as djxl does, unless turned off.
using Raster plain = Raster.Load("sprite.jxl", options: new JxlReaderOptions { RenderSpotColors = false });

Properties

AlphaPremultiplied

Gets whether the color is premultiplied by this alpha channel in the file (Load gives it straight).

public bool AlphaPremultiplied { get; init; }

Property Value

bool

BitsPerSample

Gets the bits of a sample.

public int BitsPerSample { get; init; }

Property Value

int

ExponentBits

Gets the exponent bits of floating-point samples, or 0 for integer samples.

public int ExponentBits { get; init; }

Property Value

int

Kind

Gets what the channel holds.

public JxlExtraChannelKind Kind { get; init; }

Property Value

JxlExtraChannelKind

Name

Gets the channel's name, or an empty string.

public string Name { get; init; }

Property Value

string

SpotColor

Gets a spot color's red, green, blue and solidity, or null for other channels.

public IReadOnlyList<float>? SpotColor { get; init; }

Property Value

IReadOnlyList<float>

Subsampling

Gets how many times the channel is halved each way against the image (0 for full size).

public int Subsampling { get; init; }

Property Value

int