Struct Jpeg2000Channel
One channel definition of a JP2 file (cdef).
public readonly record struct Jpeg2000Channel : IEquatable<Jpeg2000Channel>
- Implements
- Inherited Members
Examples
using Raster image = Raster.Load("photo.jp2");
var details = (Jpeg2000Details)image.Metadata.FormatDetails!;
Console.WriteLine($"{details.Container}, {(details.Reversible ? "lossless 5/3" : "lossy 9/7")}, {details.DecompositionLevels} levels");
Console.WriteLine($"{details.QualityLayers} layers in {details.ProgressionOrder} order, {details.TileCount} tiles, {details.ColorSpace}");
foreach (Jpeg2000Component component in details.Components)
{
Console.WriteLine($"{component.Precision} bits{(component.IsSigned ? " signed" : "")}, sampled every {component.SubsamplingX}×{component.SubsamplingY}");
}
foreach (Jpeg2000Channel channel in details.Channels)
{
Console.WriteLine($"Channel {channel.Channel}: {channel.Type} for color {channel.Association}");
}
Constructors
Jpeg2000Channel(int, Jpeg2000ChannelType, int)
One channel definition of a JP2 file (cdef).
public Jpeg2000Channel(int Channel, Jpeg2000ChannelType Type, int Association)
Parameters
ChannelintThe channel's index.
TypeJpeg2000ChannelTypeWhat the channel is.
AssociationintThe color the channel belongs to, counting from 1; 0 for the whole image; -1 for none.
Examples
using Raster image = Raster.Load("photo.jp2");
var details = (Jpeg2000Details)image.Metadata.FormatDetails!;
Console.WriteLine($"{details.Container}, {(details.Reversible ? "lossless 5/3" : "lossy 9/7")}, {details.DecompositionLevels} levels");
Console.WriteLine($"{details.QualityLayers} layers in {details.ProgressionOrder} order, {details.TileCount} tiles, {details.ColorSpace}");
foreach (Jpeg2000Component component in details.Components)
{
Console.WriteLine($"{component.Precision} bits{(component.IsSigned ? " signed" : "")}, sampled every {component.SubsamplingX}×{component.SubsamplingY}");
}
foreach (Jpeg2000Channel channel in details.Channels)
{
Console.WriteLine($"Channel {channel.Channel}: {channel.Type} for color {channel.Association}");
}
Properties
Association
The color the channel belongs to, counting from 1; 0 for the whole image; -1 for none.
public int Association { get; init; }
Property Value
Channel
The channel's index.
public int Channel { get; init; }
Property Value
Type
What the channel is.
public Jpeg2000ChannelType Type { get; init; }