Yesterday, 07:36 AM
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 ()
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 ()