Class JxlExtraChannel
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
BitsPerSample
Gets the bits of a sample.
public int BitsPerSample { get; init; }
Property Value
ExponentBits
Gets the exponent bits of floating-point samples, or 0 for integer samples.
public int ExponentBits { get; init; }
Property Value
Kind
Gets what the channel holds.
public JxlExtraChannelKind Kind { get; init; }
Property Value
Name
Gets the channel's name, or an empty string.
public string Name { get; init; }
Property Value
SpotColor
Gets a spot color's red, green, blue and solidity, or null for other channels.
public IReadOnlyList<float>? SpotColor { get; init; }
Property Value
Subsampling
Gets how many times the channel is halved each way against the image (0 for full size).
public int Subsampling { get; init; }