Added an invert parameter to invert the roto masks.