This is a question about programming. I want to process each pixel of a layer. The layer contains a non-rectangular image (for example, something I lassoed, copied, and pasted into a new layer.) At least to the user, it looks non-rectangular. But it seems like when programming Gimp, every region is rectangular? When iterating over the pixels of a region, how do you tell a pixel is inside the non-rectangular shape?
It looks complex. For a background layer with an alpha channel, it seems as though you could check for pixels of (0,0,0,0) (black with a transparent alpha, which appears as a checkerboard to the user.) But for a background layer without an alpha channel, it seems as though you would need to check for a pixel of (255, 255, 255) (appears white, without an alpha channel) but that would exclude white pixels within the non-rectangular shape?
The context is that I am looking at the resynthesizer plugin. Suppose you rotate an image, leaving wedges of transparency at the corners, and select one wedge to resynthesize. The context is the invert of the selection and includes transparent wedges that you haven't resynthesized yet. I think the resynthesizer should exclude those other wedges from the context.