sto cercando nel mio plug in di riuscire a contare i layer e ad identificare l'id sempre dei layers che vado ad applicare all'immagine prima di avviare il plug in
sto cercando di utilizzare questa funzione:
Codice: Seleziona tutto
gimp_image_get_layers ()
gint* gimp_image_get_layers (gint32 image_ID,
gint *num_layers);
Returns the list of layers contained in the specified image.
This procedure returns the list of layers contained in the specified image. The order of layers is from topmost to bottommost.
image_ID : The image.
num_layers : The number of layers contained in the image.
Returns : The list of layers contained in the image.
Codice: Seleziona tutto
gint32* layers;
gint32 layers_number;
layers = gimp_image_get_layers (drawable->drawable_id, &layers_number);
gint num = sizeof (layers) / sizeof (layers[0]);
gint h = 0;
for(h = 0; h < num; h++){g_message("%i", layers[h]);}
grazie
