I understand. The layer would have properties do define where the 4 limits are, and a rectangle where to draw the resulting image.
But i'd rather do it as a filter that produces the content of the layer, because TBGRALayeredBitmap, with just blending modes, can be stored and loaded from an OpenRaster file. So if I stick to simple layer operations, there will be more interoperability. If I add special features, then I will need to create a specific image format for LazPaint. I was thinking about it, but well, it's not necessary in fact, and it would be yet another layered bitmap format.
I've added some little things to my OpenRaster format, like more blending modes, and gamma correction option. Gamma correction is not a big issue, and custom blending modes, well, anyway, it is not very clear where to stop with blending modes.
One thing that could be added to, is a reference to another image to define a layer. Some layer would be the copy of some external layered bitmap. Of course, the flattened image of the external file would be stored inside the layered image, so that it can be opened without that external file. But it would be updated if necessary. There may be circular references to check, but it would be an easy way to implement complex structures, instead of grouping layers inside one file.