Cast user-supplied masks to boolean arrays