gimp_image_*_colormap*() functions have a problematic signature for introspection
When creating !921 (merged), I noticed that the gimp_image_get_colormap()
and gimp_image_set_colormap()
have several issues:
- They return/accept an array of raw bytes, which needs to have a
size
argument to be properly introspectable. They don't have that, but anum_colors
argument instead which is then supposed to be multiplied by 3 to get the actual number bytes. Bindings can't know this though - It assumes that it can only have RGB888 format (no alpha, no higher bit depth)
- Returning a
uint8
is not really semantically useful
Possible solutions:
Return/Accept aGimpRGB
array instead of raw bytes, so that the length argument works out for bindings tooCreate aGimpColorMap
object, which then also allows to have extra methods that are now distributed over multiple methods in GimpImage (e.g. gimp_image_get_colormap_size() or gimp_image_get_colormap_entry())
EDIT:
Actually, I talked to @simon and it would be better to remove this API in favor of using the get_palette()
methods
Edited by Niels De Graef