Re: [Gimp-developer] Of Palettes and Plug-ins



I thought that the palette loader code that is currently there created a
palette before putting it in the UI. However, upon closer inspection, each
of the loaders appear to create a palette based on the filename being
imported, then the common code in gimp renames the object. Given that the
current code isn't importing the palette atomically, I will just do the
same thing. I think I see how to make this work.

This has been helpful.

Thanks,
wt


On Sat, Sep 7, 2013 at 5:15 AM, Joao S. O. Bueno <gwidion mpc com br> wrote:

On 7 September 2013 04:18, Warren Turkal <wt penguintechs org> wrote:
I haven't found any way to make that interface work for what I am doing.
Basically, I need to be able to return a palette object, but not one in
the
UI yet. That palette object can then be loaded by the existing gimp code
into a new palette in the UI. Note that this is a slightly simplified
description as all the current palette "loaders" return a GList* with
only
one entry to a palette object. This code is here.

No, there is no such thing as a Palette object, but not one on the UI yet
in GIMP.
You create  a new palette live, in GIMP.
If you  need it not to appear in the objec, just maintain all palette
data in a data structure
in your own code.
(In python it would be a list of tuples - or a list of dictionaries if you
need
better than O(N) access to an entry given its name or it's core value)
And you will need a function call to "commit" your data structure to
a palette in the UI when it is the time -
That would be about five lines of code, including
the function declaration.

If you want to access a non-UI visible GIMP Palette  in several
plug-ins, and want to use GIMP's palette PDB calls for that,
you have to, in the same plug-in: commit your data to a new, temporary,
GIMP Palette, do whatever you want with it (including exporting for an
specific format by calling another plug-in), and remove it from GIMP's
Palette list with pdb.gimp_palette_delete.

  js
 -><-



  js
 -><-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]