static bool isValidMaskPattern(int maskPattern) { return maskPattern >= 0 && maskPattern < numMaskPatterns; }