PDA

View Full Version : Purge output buffer?



Anti-Distinctly
04-12-2007, 03:34 AM
Hi guys,
I'm currently writing an image filter plugin and the way this plugin works is to perform calculations per line horizontally, then take those results and perform the same calculations on a vertical column of pixels.
The problem being that the algorithm needs the results of the first stage to be input to the second stage, but the output buffer is not written to the image until after the plugin exits it seems that way, correct me if I'm wrong).

So, is there a way to force the output buffer to be written mid code?
I'm writing with fa->setRGB(x, y, out); and I want those values to be the ones that are read off when I call the function to get the scanline.

Anti-Distinctly
04-16-2007, 07:13 AM
Guys, I just need to know if this is at all possible. From the lack of responses it looks like 'no', but can anyone confirm? If this is the case I've got to rewrite a load of code.

Lightwolf
04-16-2007, 07:28 AM
Guys, I just need to know if this is at all possible. From the lack of responses it looks like 'no', but can anyone confirm? If this is the case I've got to rewrite a load of code.
No.

Feel better now? ;)

You could of course plit up your algorithm int two plugins :D

Cheers,
Mike

Pomfried
04-16-2007, 10:47 AM
Not sure what you are trying to do, but wouldn't it be possible for you to create your own image buffer while doing your work on the horizontal lines, then use that for the vertical calculations and finally use your fa->setRGB(x, y, out) but with the RGB values from your own buffer?
Sure it wouldn't be very memory efficient but at least you would not have to rewrite that much of your code I guess.

Anti-Distinctly
04-17-2007, 05:16 AM
I do feel better :D
Didn't want to split it into 2 plugins as it just seemed...inelegant I guess.
I'll just knock up my own buffer for the image, shouldn't be too much trouble. Throw a load of arrays full of pointers around and see what happens. Thanks guys! :)