-
Notifications
You must be signed in to change notification settings - Fork 386
Closed
Labels
longtermLong standing issues that need to be resolvedLong standing issues that need to be resolved
Description
Description of the desired feature
This issue tries to summarize the status of how GMT deals with image i/o and what we may wish to have. I think these statements are true - to be vetted by @joa-quim:
- The exact arrangement of r,g,b,a values in the image array I->data depends on the chosen setting via API_IMAGE_LAYOUT. The default in GMT is TRPa [RGBARGBARGBA...]. Modules can thus set the format most suitable for their use.
- We support (T|B)(R|C)(B|P). First letter says image is top down or bottom up, second letter says we go by rows or column, and third letter says the r,g,b is interleaved by bands (all R first, followed by all G, then B, then optionally A) or pixel (rgb).
- Images either have a header->n_bands value or 1 (gray), 3 (rgb) or 4 (rgba, for transparency).
- For GMT modules that wish to read images, do some manipulation, and write out a modified image, it is important that whatever layout we use we must be able to both read and write that layout. My experience with grdmix suggest we can read TRB but not write it, or write TRP but not read it.
- The GMT_IMAGE structure has a separate pointer for an alpha array. It looks like it is not filled at all when an image is read. The A bytes remain interspersed in I->data per the layout.
Seems to me we need to put in some work on the image front to reach at least these minimum goals so that basic image handling can be implemented:
- Ability to read and write at least some of the image layouts we wish to support, such as TRB and TRP.
- Ability to add or remove I->alpha before writing and have the alpha channel be added or removed in the final image. Alternatively, remove the alpha array stuff from the GMT_IMAGE struct (backwards incompatible but nobody is using alpha anyway since not fully implemented) and have a mode to accomplish this directly on I->data and n_bands.
Metadata
Metadata
Assignees
Labels
longtermLong standing issues that need to be resolvedLong standing issues that need to be resolved