libheif icon indicating copy to clipboard operation
libheif copied to clipboard

Other image pixel data-types

Open farindk opened this issue 1 year ago • 0 comments

@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 numbers heif_channel_other_first to heif_channel_other_last. If we later have specific channel names, we can also introduce heif_channel IDs for that, but I think it is difficult because, e.g., IR could be different kinds of IR.
  • there is a new heif_channel_datatype enum 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.

farindk avatar Jun 30 '24 13:06 farindk