Add apply_as_mask operation