I'm trying to write a simple plugin and I'm stuck at the combo functions gegl_buffer_get(), gegl_buffer_set(). When I _get() a buffer to a malloced memmory, the memory seems to be garbage. And when I try to _set() from the memory to a shadow buffer and merge, all I get is a black result.
Built with gimptool. It simply tries to fill the drawable with mid grey (or - if you comment the relevant lines in the for cycle - halve the input data). I was trying to follow the plugin tutorial from developer.gimp.org/writing_a_plugin, but that one is painfully out of date without gegl and I got a ton of deprecated warnings. So I tried to rewrite the logic using gegl buffers, but I failed. Well, I managed to do it in the cycle with gegl_buffer_set_color() (commented out in the cycle), but that one's painfully slow, so I thought that _get(), _set() might be faster.
At the end of the day, I want to have a plugin, which takes every pixel separately one by one and does some mathematical operation on that pixel, without the need to access multiple pixels at once.
If you could point me to my mistakes with buffer functions, I'd be grateful.