image-tiff
image-tiff copied to clipboard
Implement support for planar data
Draft because the interface is a bit odd.
read_image_bytesis enhanced to read additional planes if the buffer is large enough.PreferredBufferLayoutis augmented with fields to describe those additional requirements, with the compatibility that previous fields encode only the first plane. This should be changed in a next major version.- All the layout computation is moved into
image.rsso we have one source of truth for the layout of sub-byte color components, planes, chunk sizes, and strides. All relevant values are computed in one function and then used. expand_chunkis prepared for custom strides which it previously supported in a parameter but that would not scale to multiple planes; also support did not seem consistent? It was not exercised in the public interface and I would not have trusted that..- [ ] TODO: reading multiple chunks belonging to different planes of the same basic chunk. The interface is a bit odd since we may have a basic chunk index but if that is not on the first plane, should we then extract planes from that onwards (however much buffer space is available) or should plane selection be more explicit? Also thinking about subsampling here.. Maybe it should not be provided yet.