docs: private int[] blackWhiteRange(int fixedDimension, int maxWhiteRun, int minDim, int maxDim, boolean horizontal) {
  
      int center = (minDim + maxDim) / 2;
  
      // Scan left/up first
      int start = center;
      while (start >= minDim) {
        if (horizontal ? image.get(start, fixedDimension) : image.get(fixedDimension, start)) {
          start--;
        } else {
          int whiteRunStart = start;
          do {
            start--;
          } while (start >= minDim && !(horizontal ? image.get(start, fixedDimension) :
              image.get(fixedDimension, start)));
          int whiteRunSize = whiteRunStart - start;
          if (start < minDim || whiteRunSize > maxWhiteRun) {
            start = whiteRunStart;
            break;
          }
        }
      }
      start++;
  
      // Then try right/down
      int end = center;
      while (end < maxDim) {
        if (horizontal ? image.get(end, fixedDimension) : image.get(fixedDimension, end)) {
          end++;
        } else {
          int whiteRunStart = end;
          do {
            end++;
          } while (end < maxDim && !(horizontal ? image.get(end, fixedDimension) :
              image.get(fixedDimension, end)));
          int whiteRunSize = end - whiteRunStart;
          if (end >= maxDim || whiteRunSize > maxWhiteRun) {
            end = whiteRunStart;
            break;
          }
        }
      }
      end--;
  
      return end > start ? new int[]{start, end} : null;
    }