Table of Contents

Struct Jpeg2000Component

Namespace
Egami.Formats.Jpeg2000
Assembly
Egami.dll

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

Precision int

The bits per sample, 1 to 38.

IsSigned bool

Whether samples are signed.

SubsamplingX int

The horizontal sampling step on the reference grid (XRsiz).

SubsamplingY int

The 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

bool

Precision

The bits per sample, 1 to 38.

public int Precision { get; init; }

Property Value

int

SubsamplingX

The horizontal sampling step on the reference grid (XRsiz).

public int SubsamplingX { get; init; }

Property Value

int

SubsamplingY

The vertical sampling step on the reference grid (YRsiz).

public int SubsamplingY { get; init; }

Property Value

int