@60hz said:
I might have a solution to do the pixel access between objects without giving a name for reference, I replied to your issue here:
https://github.com/60-hz/Ofelia-Fast-Prototyping/issues/1#issuecomment-750807213
Will have to look next week I think, with holiday tomorrow and exam grading shortly after.
I got a working prototype of a pix_gain function. This may end up as a dead end: it's far too slow in Lua. I got acceptable performance by resizing the original 1008x768 image to almost a tenth of its dimensions.
The only viable solution for pix filters in Ofelia will be C plugins shaders, I think.
In case this helps someone else later: I also found that ofPixels getColor and setColor use different index semantics -- really -- getColor indexes by bytes and setColor indexes by pixels. So, for the second pixel in RGB, you'd getColor(3) but setColor(1, ...) -- I'm at a total loss to understand the rationale (unless somebody fouled up the initial implementation and then they couldn't change it without breaking compatibility). Anyway I crashed Pd several times to figure that out. Edit: Actually I think it's that the new image ended up being grayscale, even though I tried half a dozen different ways to set the colorspace. So a color is 3 bytes in the original but 1 in the processed result. Still mucking around with that. It's impressive when you 'setImageType' and it doesn't set :-/
hjh