def is_valid_point(self, pos):
    if (pos is None):
        return False
    else:
        x = pos.x()
        y = pos.y()
        if ((x >= 0) and (y >= 0) and (x < self.win_size) and (y < self.win_size)):
            return self.mask[(y, x)]
        else:
            return False
def is_valid_point(self, pos):
    if (pos is None):
        return False
    else:
        x = pos.x()
        y = pos.y()
        if ((x >= 0) and (y >= 0) and (x < self.win_size) and (y < self.win_size)):
            return self.mask[(y, x)]
        else:
            return False