libheif
libheif copied to clipboard
Other image pixel data-types
@bradh These are the changes to add new image data-types. The concept for the public API is this:
- we have more (custom)
heif_channels, with the numbersheif_channel_other_firsttoheif_channel_other_last. If we later have specific channel names, we can also introduceheif_channelIDs for that, but I think it is difficult because, e.g., IR could be different kinds of IR. - there is a new
heif_channel_datatypeenum to differentiate between integer, float, complex. The actual number of bits is stored in the existing bit-depth value. For complex, this is the total bit-depth, e.g. 128 for 2x64 bit floats. (I'm not completely sure yet whether this makes sense or it would be better to use the bit-depth per component. This is somehow different to how 'interleaved' is handled, but on the other hand, I can imaging that there are complex data-types like complex with 64bit magnitude and 16bit phase, thus a total bit-depth might make more sense). - These special channels can be stored together with the visual data in an image. If we have an image that has no visual data, we set its colorspace to
heif_colorspace_nonvisual.
This is WIP, comments welcome.
You should be able to add planes with these new datatypes to a HeifPixelImage now, but expect that not everything is working yet and public API is incomplete.
I'm probably also going to rename 'plane' to 'channel' to have a consistent naming scheme (see heif_channel).
Hence, the name to add a channel is now HeifPixelImage::add_channel, replacing the older HeifPixelImage::add_plane.