Struct Jpeg2000Component
One component of a JPEG 2000 codestream, as its SIZ marker gives it.
public readonly record struct Jpeg2000Component : IEquatable<Jpeg2000Component>
- 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
Jpeg2000Component(int, bool, int, int)
One component of a JPEG 2000 codestream, as its SIZ marker gives it.
public Jpeg2000Component(int Precision, bool IsSigned, int SubsamplingX, int SubsamplingY)
Parameters
PrecisionintThe bits per sample, 1 to 38.
IsSignedboolWhether samples are signed.
SubsamplingXintThe horizontal sampling step on the reference grid (XRsiz).
SubsamplingYintThe vertical sampling step on the reference grid (YRsiz).
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
IsSigned
Whether samples are signed.
public bool IsSigned { get; init; }
Property Value
Precision
The bits per sample, 1 to 38.
public int Precision { get; init; }
Property Value
SubsamplingX
The horizontal sampling step on the reference grid (XRsiz).
public int SubsamplingX { get; init; }
Property Value
SubsamplingY
The vertical sampling step on the reference grid (YRsiz).
public int SubsamplingY { get; init; }