[Gimp-user] Creating a new operation for GEGL



Hello developers,

I'm currently working on an implementation of a bilateral filter called "Domain
Transform Filter" (for someone interested, the work can be found here
https://dl.acm.org/citation.cfm?doid=1964921.1964964 and here
http://inf.ufrgs.br/~eslgastal/DomainTransform/).

Well, it turns out that we've decided to try to implement the filter in GEGL, so
it would become easy to use with tools like GIMP, for example. Since GEGL is
open source, I've been trying to understand the code that is used to generate
new operations and understand how could I carry the filter to the platform.

I've made some tests, and I figured out that the standard behavior of GEGL is to
split the image in several tiles, which are usually rectangles, and process all
these 'tiles' independently, even using different threads. With some inspection
of the existing GEGL code is easy to, for example, make each thread processes
its own tile and return the result. However, for the specific filter I'm
implementing, this is not enough, since it is a recursive filter.

The implementation I am using of the Domain Transform filter is a recursive one,
in which each pixel will always depend on the value of the previous pixel,
already processed. That said, I could only process a tile if the previous tile
was already processed, which is a problem. Moreover, to generate good results,
the filter must be applied several consecutive times, and each time it must be
performed top->down, bottom-up, left-right and right-left, again consecutively.
Since GEGL automatically divides the image into tiles and feed them to the
operation, I'm not sure how is the proper way to force the filter to be executed
in several steps.

With all these restrictions, I'm having some difficult to find out how can I
achieve that inside GEGL. I would be very grateful if someone could give me some
hints or even show me a code where a recursive filter is implemented as a GEGL
operation.

Thank you very much,
Felipe

-- 
felipeek2 (via www.gimpusers.com/forums)


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