Drawing on an overlay

I have a selection which is programmatically created by means of the makeRectangle function.

The pixels inside it are transformed and stored away to an array like this:

kount=0;
for(x=leftBound;x<rightBound;x++) {
for(y=upperBound;y<LowerBound;y++) {
pix=getPixel(x,y);
new_pix[kount++]=f(pix);
}
}

where f is some function defined elsewhere.

Now in order that the user be reassured the transformation has actually been applied I’d like to highlight the selection.

I could use the fill command or include this sentence

setPixel(x,y,h);

in the loop, where h is a convenient value. In either case the image would be modified which I’d rather not do.

The question is then how to do this so the modified pixels are on the overlay only.

Ooops! Sorry, I just noticed the Overlay/Options menu :blush: