Re: [Gimp-developer] pathon-scripts with GEGL?



I've writing started such CPython bindings yesterday - in time we
should expose the buffers in a proper way.

https://github.com/jsbueno/python-gegl


What is difficult to do via pygobject bindings is to make use of GEGL
itself - the linked example file of yesterday sepeaks for itself.

While GEGL in C has provisions for function calls to be made emulating
named parameters from Python, for, for example, setting various
properties at once, I didn't get that to work from Python. Moreover, a
Python user wll rather do: pngnode.path = "myfile.png" - rather than
"pngnode.set_property("path", "myfile.png") as is required by the
automated bindings.

Daniel - if you are into it, I've hit a but at my first steps: when using
GParamSpec objects (via an operation_list_properties call) I had the
Python interpreter segfaulting (it happens on trying to introspect the
GParamSpec objects with "dir",  but in other occasions I could not
isolate as well)

    js
  -><-


On 29 November 2013 05:31, Daniel Sabo <danielsabo gmail com> wrote:
Assuming were talking about gegl-master here, what are you unable to
do via introspection? The introspection bindings have full coverage of
the GEGL API. Mainipulating pixels directly (rather than though
operations) involves more copying in Python than is C because Python
has no concept of mutable buffers. It would be possible to expose
things via ctypes or numpy, but that requires writing a CPython module
and will probably not be part of GEGL itself.

To get/set raw pixels from from a gegl buffer use Buffer.get(...) and
Buffer.set(...).


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