Another GEM question... (somehow, no matter how much of GEM I learned, there is always something that you'd think would be straightforward, but isn't...)
I would like to construct a rectangular mask for an image. The mask should have a black background (suppress the pixels outside of the rectangle) with a white rectangle somewhere inside (eventually, I'd like to be able to position the rectangle using [translateXYZ]).
I have an example from awhile ago of [pix-snap]ping a shape into a pix_buffer, and then using the pix_buffer data for further processing. So I tried to apply the same logic to this problem:
- One [gemhead] draws the square, pix_snap, pix_buffer_write.
- The main [gemhead] does [t a a]
- Right-hand (first) does pix_buffer_read
- Left-hand (second) is pix_image, pix_mask, pix_texture, square
If I connect pix_buffer_read directly to pix_texture, then I see the mask as I expect.
Then the trouble begins -- I connect pix_buffer_read to pix_mask's right inlet, and... Pd hangs. I have to force quit.
- Is there another way to do this that will not crash?
- Is this just a bug? Or am I doing something wrong?