[Gegl-developer] Choosing the operation input format based the connected nodes output format



Hi all,

Yesterday night I started playing around with converting the gaussian-blur operation to only work on the channels that are part of the input pad. My goal was to make the operation "format transparent", in the sense that the output format should be equal to the input format. But after several failures, I realized that I was stuck.

The problem is as follows. I want to set my input format based on the output format of the previous node. I'm building the following network:

gegl:ppm-load → gegl:gaussian-blur → gegl:npy-save

and I feed the ppm-load with a "Y u8" image. Now, the problem is that if I in the gaussian-blur prepare function call: 

gegl_operation_get_source_format(operation, "input")

it returns NULL. Why is that? Am I correct to assume that the prepare calls are done before any processing has taken place? If so the ppm-load still doesn't know what format it will set in its output pad.

So instead I asked about the format in process(). But then I get the following warning:

(test-npy.py:2383): GEGL-gegl-operation-context.c-WARNING **: no format for gegl:gaussian-blur 0x95bb9b0 presuming RGBA float

I still haven't figured out exactly why this happens, but I would still like to know if anyone knows what I'm doing wrong, and whether dynamically choosing the input format based on the previous output format is even possible?

Thanks!
Dov



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