Commit graph

5 commits

Author SHA1 Message Date
Jehan
16a2fc58ba libgimp: fixing "palette" libgimp API unit testing.
It was an equality because I think the conversion from palette format to
"RGBA float" should go through the exact same babl code path, however it
is done in the API. And that is the case on my machine where I get
indeed perfect equality. But apparently not on the CI.

Though I guess investigating further would not be a bad idea, let's
consider this a minor issue (as a general rule, comparing float with
epsilon is still a recommended software usage), and just add a comment.
2024-09-23 12:14:19 +02:00
Jehan
c60512514c app, libgimp, pdb: change gimp_palette_get_colormap() to return a C array.
GBytes are a bit annoying to handle, so I'm renaming the PDB procedure
to a private _gimp_palette_get_bytes() instead, and making a wrapper
function which returns a C array and both the number of colors or number
of bytes. The latter is needed for introspection (otherwise the binding
can't know the size of the C array), but for the C API, both these
returned integers can be considered redundant (since one can be computed
from the oher), so only one at a time is mandatory.
2024-09-23 00:01:06 +02:00
Jehan
4708609395 app, libgimp, pdb: new gimp_palette_get_colormap() function. 2024-09-22 23:26:33 +02:00
Jehan
94853968b3 libgimp: also update unit testing for GimpColorArray.
Making sure not only that the PDB passes correctly the number of colors, but
taking one random color in the array and verifying it is correct.
2024-04-18 16:00:42 +02:00
Jehan
7b43a7492f libgimp: new unit testing framework for libgimp.
With Python binding, it gets very easy to test new functions. I've been
wondering if we need C counterparts, but really since it's a GObject
Introspection binding, if a function succeeds there, it should also succeed in C
code.

For now, I'm testing a few of GimpPalette API. Not all of it yet. Also I test
both the direct C binding and PDB procedure since in some cases, one or the
other may not properly working. See #10885.
2024-02-28 22:55:58 +01:00