static Rect getRectFromPoints(
      float[] points,
      int imageWidth,
      int imageHeight,
      boolean fixAspectRatio,
      int aspectRatioX,
      int aspectRatioY) {
    int left = Math.round(Math.max(0, getRectLeft(points)));
    int top = Math.round(Math.max(0, getRectTop(points)));
    int right = Math.round(Math.min(imageWidth, getRectRight(points)));
    int bottom = Math.round(Math.min(imageHeight, getRectBottom(points)));

    Rect rect = new Rect(left, top, right, bottom);
    if (fixAspectRatio) {
      fixRectForAspectRatio(rect, aspectRatioX, aspectRatioY);
    }

    return rect;
  }
Get a rectangle for the given 4 points (x0,y0,x1,y1,x2,y2,x3,y3) by finding the min/max 2
points that contains the given 4 points and is a straight rectangle.
core/src/main/java/com/theartofdev/edmodo/cropper/BitmapUtils.java