code: public void setRegion(int left, int top, int width, int height) {
      if (top < 0 || left < 0) {
        throw new IllegalArgumentException("Left and top must be nonnegative");
      }
      if (height < 1 || width < 1) {
        throw new IllegalArgumentException("Height and width must be at least 1");
      }
      int right = left + width;
      int bottom = top + height;
      if (bottom > this.height || right > this.width) {
        throw new IllegalArgumentException("The region must fit inside the matrix");
      }
      for (int y = top; y < bottom; y++) {
        int offset = y * rowSize;
        for (int x = left; x < right; x++) {
          bits[offset + (x / 32)] |= 1 << (x & 0x1f);
        }
      }
    }
docs: <p>Sets a square region of the bit matrix to true.</p>
  
  @param left The horizontal position to begin at (inclusive)
  @param top The vertical position to begin at (inclusive)
  @param width The width of the region
  @param height The height of the region