You can't show a drawable by itself, it needs to be in an image. Also, an
image can't show itself, you must create a display for that. You are also
using the API in weird ways, for example, objects such as layers and images
are represented by integers in the plug-in context.
You are also saying that the plug-in takes the active image and drawable as
parameter, but since you are creating a new image, you are not interested in
those values (I assume) so there is no point in specifying these as
arguments to the hello-world procedure.
This is my first attempt to write a GIMP plugin, as you probably have
guessed by now =)
I have attached a rewritten version of main.c (called hello-world.c since
that is a name that doesn't conflict as much) that should do what you want.
You might also want to consider using a scripting language like Scheme or
Python for this.
Wow. That's amazing. Thank you very much =)
What I ultimately would like to end up with is being able to set
pixels, the user makes changes to the image, and I read the pixels one
by one again.
So now I have tried to set a pixel like so
/* Trying to set a pixel at x=5,y=5 with value 150 */
GimpDrawable* drawable;
drawable = gimp_drawable_get (layer);
/* Trying to set a pixel at x=5,y=5 with value 150 in 24 bit color */
gboolean s;
s = gimp_drawable_set_pixel (drawable, 5, 5, 24, 150);
But when I compile I get:
hello-world.c:73: warning: passing argument 1 of
‘gimp_drawable_set_pixel’ makes integer from pointer without a cast
/usr/include/gimp-2.0/libgimp/gimpdrawable_pdb.h:89: note: expected
‘gint32’ but argument is of type ‘struct GimpDrawable *’
The code is attached. I am bit lost how to solve this.
Any help will be very appreciated =)