Nitf

class Nitf

Top-level entry point for reading National Imagery Transmission Format (NITF) 2.1 and NATO Secondary Imagery Format (NSIF) 1.0 files.

The reader is cross-platform — all parsing lives in commonMain on top of BinaryDataView — and currently covers:

  • File header + segment offset table (image / graphic / text / DES / RES).

  • Image segment subheaders with full metadata + IGEOLO decoding for the G (DMS) / D (decimal degrees) / N (UTM north) / S (UTM south) coord systems (MGRS = U is parsed but not converted yet).

  • Uncompressed pixel data (IC=NC and IC=NM, with the NM block mask) for NBPP ∈ {8, 16}, NBANDS ∈ {1, 3, 4}, all four IMODE values.

Compressed segments (JPEG / JPEG-2000 / VQ / bilevel) require platform image decoders and ship in Phase 2.

Two entry points cover the common needs:

  • Nitf.parse — full parse from a byte array; segment headers populated.

  • Nitf.readMetadata — file header only (just enough to enumerate segments without paying for image subheader decoding).

Reading pixels:

val nitf = Nitf.parse(bytes)
val seg = nitf.imageSegments.first()
if (seg.compression == NitfCompression.NC) {
val argb = NitfImageReader.decodeArgb(seg, bytes)
}

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Format + version pair (NITF 02.10 or NSIF 01.00).

Link copied to clipboard