code: def get_shape_mask(self, shape_obj):
          
          wd, ht = self.get_size()
          yi = np.mgrid[:ht].reshape(-1, 1)
          xi = np.mgrid[:wd].reshape(1, -1)
          pts = np.asarray((xi, yi)).T
          contains = shape_obj.contains_pts(pts)
          return contains
docs: Return full mask where True marks pixels within the given shape.