Computes an axis-aligned rectangle that contains all the inliers.  It then computes the area contained in
that rectangle to the total area of the image

@param imageArea width*height
328378
private void computeContainment( int imageArea ) {
		// mark that the track is in the inlier set and compute the containment rectangle
		contRect.x0 = contRect.y0 = Double.MAX_VALUE;
		contRect.x1 = contRect.y1 = -Double.MAX_VALUE;
		for( AssociatedPair p : motion.getModelMatcher().getMatchSet() ) {
			Point2D_F64 t = p.p2;
			if( t.x > contRect.x1 )
				contRect.x1 = t.x;
			if( t.y > contRect.y1 )
				contRect.y1 = t.y;
			if( t.x < contRect.x0 )
				contRect.x0 = t.x;
			if( t.y < contRect.y0 )
				contRect.y0 = t.y;
		}
		containment = contRect.area()/imageArea;
	}
1206072
protected final boolean isValidSize (int width, int height)
    {
        if (width < 0 || height < 0) {
            log.warning("Attempt to add invalid dirty region?!",
                        "size", (width + "x" + height), new Exception());
            return false;

        } else if (width == 0 || height == 0) {
            // no need to complain about zero sized rectangles, just ignore them
            return false;

        } else {
            return true;
        }
    }
846272
private void computeScales() {
		int width = getWidth();
		int height = getHeight();

		width = (width-borderSize)/2;

		// compute the scale factor for each image
		scaleLeft = scaleRight = 1;
		if( leftImage.getWidth() > width || leftImage.getHeight() > height ) {
			double scaleX = (double)width/(double)leftImage.getWidth();
			double scaleY = (double)height/(double)leftImage.getHeight();
			scaleLeft = Math.min(scaleX,scaleY);
		}
		if( rightImage.getWidth() > width || rightImage.getHeight() > height ) {
			double scaleX = (double)width/(double)rightImage.getWidth();
			double scaleY = (double)height/(double)rightImage.getHeight();
			scaleRight = Math.min(scaleX,scaleY);
		}
	}
479356
public Settings setMovementArea(int width, int height) {
        isMovementAreaSpecified = true;
        movementAreaW = width;
        movementAreaH = height;
        return this;
    }
1209783
public static <S> PAreaL<S> toPAreaL(final AreaL a)
  {
    Objects.requireNonNull(a, "area");
    return PAreaL.of(a.minimumX(), a.maximumX(), a.minimumY(), a.maximumY());
  }
398754
private RectangleArranger<PlotItem> arrangeVisualizations(double width, double height) {
    if(!(width > 0. && height > 0.)) {
      LOG.warning("No size information during arrange()", new Throwable());
      return new RectangleArranger<>(1., 1.);
    }
    RectangleArranger<PlotItem> plotmap = new RectangleArranger<>(width, height);

    Hierarchy<Object> vistree = context.getVisHierarchy();
    for(It<Projector> iter2 = vistree.iterAll().filter(Projector.class); iter2.valid(); iter2.advance()) {
      Collection<PlotItem> projs = iter2.get().arrange(context);
      for(PlotItem it : projs) {
        if(it.w <= 0.0 || it.h <= 0.0) {
          LOG.warning("Plot item with improper size information: " + it);
          continue;
        }
        plotmap.put(it.w, it.h, it);
      }
    }

    nextTask: for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); iter2.valid(); iter2.advance()) {
      VisualizationTask task = iter2.get();
      if(!task.isVisible()) {
        continue;
      }
      if(vistree.iterParents(task).filter(Projector.class).valid()) {
        continue nextTask;
      }
      if(task.getRequestedWidth() <= 0.0 || task.getRequestedHeight() <= 0.0) {
        LOG.warning("Task with improper size information: " + task);
        continue;
      }
      PlotItem it = new PlotItem(task.getRequestedWidth(), task.getRequestedHeight(), null);
      it.tasks.add(task);
      plotmap.put(it.w, it.h, it);
    }
    return plotmap;
  }
675973
public static void fullViewLeft(int imageWidth,int imageHeight,
									DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight )
	{
		ImplRectifyImageOps_F64.fullViewLeft(imageWidth, imageHeight, rectifyLeft, rectifyRight);
	}
372201
def resize_by_area(img, size):
  """"""
  return tf.to_int64(
      tf.image.resize_images(img, [size, size], tf.image.ResizeMethod.AREA))
369477
function(width, height) {
									var newImage = svgCanvas.addSvgElementFromJson({
										element: 'image',
										attr: {
											x: 0,
											y: 0,
											width: width,
											height: height,
											id: svgCanvas.getNextId(),
											style: 'pointer-events:inherit'
										}
									});
									svgCanvas.setHref(newImage, e.target.result);
									svgCanvas.selectOnly([newImage]);
									svgCanvas.alignSelectedElements('m', 'page');
									svgCanvas.alignSelectedElements('c', 'page');
									updateContextPanel();
								}
1259279
public function setRegion(int $left, int $top, int $width, int $height) : void
    {
        if ($top < 0 || $left < 0) {
            throw new InvalidArgumentException('Left and top must be non-negative');
        }

        if ($height < 1 || $width < 1) {
            throw new InvalidArgumentException('Width and height must be at least 1');
        }

        $right = $left + $width;
        $bottom = $top + $height;

        if ($bottom > $this->height || $right > $this->width) {
            throw new InvalidArgumentException('The region must fit inside the matrix');
        }

        for ($y = $top; $y < $bottom; ++$y) {
            $offset = $y * $this->rowSize;

            for ($x = $left; $x < $right; ++$x) {
                $index = $offset + ($x >> 5);
                $this->bits[$index] = $this->bits[$index] | (1 << ($x & 0x1f));
            }
        }
    }
589608
private void analyzeAreaSeparators(AreaImpl area)
    {
        boolean isep = area.isExplicitlySeparated() || area.isBackgroundSeparated();
        if (isep || area.separatedUp())
            bsep.add(new Separator(Separator.BOXH,
                                   area.getX1(), area.getY1(), area.getX2(), area.getY1() + ART_SEP_WIDTH - 1));
        if (isep || area.separatedDown())
            bsep.add(new Separator(Separator.BOXH,
                                   area.getX1(), area.getY2() - ART_SEP_WIDTH + 1, area.getX2(), area.getY2()));
        if (isep || area.separatedLeft())
            bsep.add(new Separator(Separator.BOXV,
                                   area.getX1(), area.getY1(), area.getX1() + ART_SEP_WIDTH - 1, area.getY2()));
        if (isep || area.separatedRight())
            bsep.add(new Separator(Separator.BOXV,
                                   area.getX2() - ART_SEP_WIDTH + 1, area.getY1(), area.getX2(), area.getY2()));
    }
851534
public static function CalculateOffset($x, $y, $image_width, $image_height, $item_width = null, $item_height = null)
  {
    //WIDTH
    if ($x == 'left') {
      $x = 0;
    } elseif ($x == 'center') {
      $x = floor($image_width / 2 - $item_width / 2);
    } elseif ($x == 'right') {
      $x = $image_width - $item_width;
    } elseif (strpos($x, '%')) {
      $x = floor((($image_width / 100) * $x) - ($item_width / 2));
      if ($x < 0) {
        $x = 0;
      }
      if (($x + $item_width) > $image_width) {
        $x = $image_width - $item_width;
      }
    } elseif ($x < 0) {
      $x = $image_width - $item_width + $x;
    }

    //HEIGHT
    if ($y == 'top') {
      $y = 0;
    } elseif ($y == 'center' || $y == 'middle') {
      $y = floor($image_height / 2 - $item_height / 2);
    } elseif ($y == 'bottom') {
      $y = $image_height - $item_height;
    } elseif (strpos($y, '%')) {
      $y = floor((($image_height / 100) * $y) - ($item_height / 2));
      if ($y < 0) {
        $y = 0;
      }
      if (($y + $item_height) > $image_height) {
        $y = $image_height - $item_height;
      }
    } elseif ($y < 0) {
      $y = $image_height - $item_height + $y;
    }

    return array((int)$x, (int)$y);
  }
785307
private RegionData findUsableRegion(int width, int height) {
        final int imageWidth = image.getWidth();
        final int imageHeight = image.getHeight();
        for (int y = 0; y < imageHeight - height; y++) {
            for (int x = 0; x < imageWidth - width; x++) {
                final RegionData data = new RegionData(x, y, width, height);
                if (!intersectsOtherTexture(data)) {
                    return data;
                }
            }
        }
        return null;
    }
732262
public static <S> AreaSizeF toAreaSizeF(final PAreaSizeF<S> a)
  {
    Objects.requireNonNull(a, "area size");
    return AreaSizeF.of(a.sizeX(), a.sizeY());
  }
106861
public void setScrollableArea (int x, int y, int width, int height)
    {
        Rectangle vb = _panel.getViewBounds();
        int hmax = x + width, vmax = y + height, value;

        if (width > vb.width) {
            value = MathUtil.bound(x, _hrange.getValue(), hmax - vb.width);
            _hrange.setRangeProperties(value, vb.width, x, hmax, false);
        } else {
            // Let's center it and lock it down.
            int newx = x - (vb.width - width)/2;
            _hrange.setRangeProperties(newx, 0, newx, newx, false);
        }
        if (height > vb.height) {
            value = MathUtil.bound(y, _vrange.getValue(), vmax - vb.height);
            _vrange.setRangeProperties(value, vb.height, y, vmax, false);
        } else {
            // Let's center it and lock it down.
            int newy = y - (vb.height - height)/2;
            _vrange.setRangeProperties(newy, 0, newy, newy, false);
        }
    }
251344
private Area getArea(double simplifyTolerance, BoundingBox boundingBox,
			ProjectionTransform transform, Polygon polygon) {

		Area area = null;

		for (LineString ring : polygon.getRings()) {

			Path2D path = getPath(simplifyTolerance, boundingBox, transform,
					ring);
			Area ringArea = new Area(path);

			if (area == null) {
				area = ringArea;
			} else {
				area.subtract(ringArea);
			}

		}

		return area;
	}
571116
@Override
    public void draw(Graphics2D g, int width, int height)
    {
        Rectangle bounds = getOwner().getAbsoluteBackgroundBounds();
        computeCoordinates(bounds);
        drawScaledImage(g, image, bounds.x + imgx, bounds.y + imgy, observer);
    }