Repository navigation
OpenXISF 0.2.0
OpenXISF 0.2.0 writes monolithic units (.xisf), alongside the reader of 0.1.0. Before 1.0, minor versions may change the API.
What it writes
openxisf::writertakes the model that the reader returns: the metadata of a unit, its images with their pixel data, properties of every type, tables, and what describes each image (FITS keywords, ICC profile, RGB working space, display function, colour filter array, resolution and thumbnail). A unit that was read can be written again.- The whole unit is checked against the specification before a byte of it is written. A
validation_errornames the object at fault by the path of its element, such as/xisf/Image[2]/Property[@id='Instrument:Filter'], and the attribute. - By default, blocks are written uncompressed and without checksums, and no UUIDs are generated, so that every XISF 1.0 decoder reads the result. On request, the writer compresses blocks with zlib, LZ4, LZ4HC or Zstandard, with byte shuffling and subblocks, adds SHA-1, SHA-2 or SHA-3 checksums, and gives images version 4 UUIDs.
- A unit is saved to a path, whose file is replaced only once the new one is complete and can be flushed to disk first, or to a sink of the application, with progress and cancellation. One writer can save from several threads at once.
- The headers that the writer produces validate against the official XISF 1.0 schema.
to_date_time()converts astd::chronotime point to adate_timeproperty value. The new sample programwrite_imagewrites an RGB image with properties, FITS keywords and a thumbnail.
Compatibility
- PixInsight 1.9.4 opens the units that the writer produces, within its own abilities. It refuses units with SHA3-256 or SHA3-512 checksums, which are optional for decoders, and it does not open UInt64 or one-dimensional images.
- A subblock that its codec does not make smaller is stored as it is, with equal compressed and uncompressed sizes. That is how PixInsight writes such subblocks and how it reads them, but the specification does not describe it, and decoders that follow only the specification cannot read them. Without
write_options::subblock_size, a block is divided into subblocks only when it is larger than its codec takes at once: about 2 GiB for LZ4 and LZ4HC, 4 GiB for zlib, and never for Zstandard.
Not yet
Distributed units (.xish and .xisb), the colour and display algorithms of the specification, property format rendering, astrometric solutions, and signed units. The writer writes attached and inline blocks in little-endian byte order, and writes an element that several images share once for each of them.
Building and testing
The library builds with CMake 3.25 or newer and installs a CMake package (find_package(openxisf CONFIG REQUIRED)) and a pkg-config file. Its dependencies are pugixml, zlib, LZ4 and Zstandard. See the README for the presets and options.
The tests of this release pass in CI on Linux (GCC 14 and Clang 18 with libstdc++ and libc++, x64 and arm64, with AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer, clang-tidy and fuzzing), on Windows (MSVC x64 and arm64, clang-cl, MSYS2 UCRT64 and CLANG64) and on macOS (AppleClang, arm64 and x64), and the vcpkg port builds on all three.
The API documentation is attached as openxisf-0.2.0-docs.tar.gz.