The masking code itself can remain where it was. When you make the variable global and load it in setup() as you have now done, the image will be accessible everywhere in your sketch. Both in the draw() loop and all the classes you make. So you can move line 21 back inside the class.
↧