Java implementation of a baseline XISF Encoder and XISF Decoder.
Based on the open specification of XISF 1.0 at https://pixinsight.com/doc/docs/XISF-1.0-spec/XISF-1.0-spec.html
- Quite a few things are implemented with byte buffers somewhat by necessity (the byte shuffling for instance). Java byte arrays have a 2GB size limit since the index is a signed 32-bit integer. Since a debayered 32-bit float image from an ASI6200 camera is already 700MB in size, this is likely to become problematic in the near future. However, even when working around that issue holding that much data in 1 contiguous block of RAM is also not self-evident. The real solution is random access, but compression support and the (monolithic) file format really doesn't lend itself to that.
try (var reader = new XISFReader(inputStream)) {
var header = reader.getHeader();
var image = header.getImages(0); // first image, there could be more!
var bytes = getImageData(image); // bytes are the uncompressed, raw bytes. The ByteBuffer has the right byte order set.
}
A baseline XISF encoder shall have at least the following abilities to generate XISF units:
- Write monolithic XISF files.
- Write a single Image core element to a monolithic XISF file.
- Write pixel data as an XISF block with attachment block location.
- Write pixel data in the planar pixel storage model.
- Write pixel data in the UInt16 pixel sample format.
- Write pixel data encoded in the grayscale and RGB color spaces.
A baseline XISF decoder shall have at least the following abilities to read XISF units:
- Read monolithic XISF files.
- Read multiple Image core elements from a monolithic XISF file.
- Support all standard compression codecs defined in this specification for decompression.
- Read pixel data from XISF blocks with inline, embedded and attachment block locations.
- Read pixel data in the planar and normal pixel storage models.
- Read pixel data in the UInt8, UInt16 and Float32 pixel sample formats.
- Read pixel data encoded in the grayscale and RGB color spaces.