support zstd compressed CZI
CZI has two zstd compression modes: zstd0 and zstd1.
In zstd0 mode, pixel data is compressed with zstd and stored in subblock
as it is.
zstd1 mode is different in that it prefix the zstd compressed data with
a header. This header is either 1 byte or 3 bytes long. The first byte
of the header is its length. CZI may use a trick called high low byte
unpack, which packs less significant byte of 16bits pixels in the first
half of the image array, and more significant byte in the second half of
the image array, before been compressed by zstd. This trick is used if:
- the header length is 3, and
- the second byte in the header is 1, and
- the lowest bit of the third byte is 1
Obviously this trick only applies to 16bits grayscale images and 48bits
color images.
Signed-off-by:
Wei Chen <chenw1@uthscsa.edu>
Loading
Please sign in to comment