On Mon, Sep 13, 2010 at 05:21:09PM -0300, Joao S. O. Bueno wrote:
> On Sun, Sep 12, 2010 at 8:58 AM,  <oli...@first.in-berlin.de> wrote:
> > Hello,
> Hi
> >
> > I tried drawing per Script.
> > I'm using Python.
> >
> > I can already use vectors for drawing circles,
> > and set single points.
> >
> > I did not found a way to create rectangles,
> > or lines.
> You are probablu using pdb_gimp_vectors_bezier_stroke_new_ellipse
> to draw circles, right?

I use:

So I think it's what you are talking about, just
the absolute name is different.

> What does prevent you from using the calls for
> gimp_vectors_bezier_stroke_new_moveto and
> gimp_vectors_bezier_stroke_lineto to draw lines?

I looked for "draw" and did not find functions that do it.
So, in short words: I did not found thos functions.

> (Don't  forget to alias then in your code to shorter names, last you
> have really undereadable stuff)

If it does not eat up too much ressources in Python...

...you mean using def for creating a function that just calls the other one?
or are "alias"es what Python offers as a separate feature?

> > Aren't there pdb-functions that draw a line?
> >
> > Do I have to create it pixelwise?
> > In a loop?
> >
> As I stated above, there are calls to draw lines.
> Are you even using the procedure browser? (Help menu - > Procedure browser) -

I use the procedure browser.
But it does not help me, if I look for names that aren't there....
...if I look for "draw" I got nothing.
The circle-drawing function via bezier I found by accident/chance.

> In Python you can access the image data directly, using calls to get
> the pixel regions if you want to as well (that is about 100x  faster
> than gimp_drawable_set_pixel  due to the function calls involved for
> each pixel change)

How can I access the pixel data directly?

That would be very interesting to me, especially for some other scripts,
where I think about even more intensive work.

> So, besides my hints above: when I need speed on a PDB using script
> (which includes python scripts),
> I found out that GIMP's undo system is the cause for a significant slow down.
> Creating an Undo group does not help - you have to disbale the undo with
> pdb.gimp_image_undo_disable

OK, I will try that.

Thanks for all that hints. :)

Gimp-developer mailing list

Reply via email to