Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GEGL kaleidoscope
#3
Thanks teapot.
Do you have an example of how you call gegl command?

I tried using the below found code but it's breaking for me.
def use_gegl_graph(image, drawable, gegl_graph_string):
class GeglBuffer(Structure):
pass
drawable_id = drawable.ID

gegl = load_library ('libgegl-0.4')
sucess = gegl.gegl_init (None, None)
gimp.gimp_drawable_get_shadow_buffer.restype = POINTER (GeglBuffer)
gimp.gimp_drawable_get_buffer.restype = POINTER (GeglBuffer)

x = c_int (); y = c_int (); w = c_int (); h = c_int ()
non_empty,x,y,w,h = pdb.gimp_drawable_mask_intersect (drawable)
args = [b"string", c_char_p (gegl_graph_string), c_void_p ()]

if non_empty:
source = gimp.gimp_drawable_get_buffer (drawable_id)
target = gimp.gimp_drawable_get_shadow_buffer (drawable_id)
sucess = gegl.gegl_render_op (source, target, "gegl:gegl", *args)
gegl.gegl_buffer_flush (target)
gimp.gimp_drawable_merge_shadow (drawable_id, PushUndo = True)
gimp.gimp_drawable_update (drawable_id, x, y, w, h)
gimp.gimp_displays_flush ()
Reply


Messages In This Thread
GEGL kaleidoscope - by trandoductin - Yesterday, 01:24 AM
RE: GEGL kaleidoscope - by teapot - Yesterday, 04:19 AM
RE: GEGL kaleidoscope - by trandoductin - Yesterday, 07:36 AM
RE: GEGL kaleidoscope - by teapot - Yesterday, 09:29 AM
RE: GEGL kaleidoscope - by trandoductin - Yesterday, 12:19 PM
RE: GEGL kaleidoscope - by rich2005 - Yesterday, 12:49 PM
RE: GEGL kaleidoscope - by trandoductin - Yesterday, 01:28 PM
RE: GEGL kaleidoscope - by teapot - 9 hours ago

Forum Jump: