Enum JpegLsInterleave
How the components of a JPEG-LS scan are interleaved (T.87 annex A.8).
public enum JpegLsInterleave
Fields
Line = 1One scan; each line of the image holds a line of every component in turn.
None = 0One scan per component, each holding a whole plane.
Sample = 2One scan; each pixel holds every component in turn.
Examples
// Near-lossless: every sample within 2 of the original, for a much smaller file. Restart markers every 64 lines let a
// damaged file be read again from the next one.
using (FileStream near = File.Create("duck-near.jls"))
{
duck.Save(near, JpegLsFormat.Info, new JpegLsWriterOptions { Near = 2, RestartInterval = 64 });
}
// Lossless with HP's colour transform, which shrinks most photographs further, sample-interleaved.
using (FileStream hp = File.Create("duck-hp1.jls"))
{
duck.Save(hp, JpegLsFormat.Info, new JpegLsWriterOptions { ColorTransform = JpegLsColorTransform.Hp1, Interleave = JpegLsInterleave.Sample });
}
// 12-bit samples from a 16-bit raster, as medical images often store them.
using Raster<Gray16> scan = duck.As<Gray16>();
using (FileStream twelve = File.Create("scan-12.jls"))
{
scan.Save(twelve, JpegLsFormat.Info, new JpegLsWriterOptions { BitsPerSample = 12 });
}