# Class VisionRect

java.lang.Object
com.codename1.ai.vision.VisionRect

public final class VisionRect extends Object
Immutable normalized rectangle using a top-left origin. X/Y identify the upper-left corner and width/height are fractions of the oriented input dimensions. `EMPTY` represents unavailable geometry.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final VisionRect`
  `EMPTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VisionRect(float x, float y, float width, float height)`
  Creates a rectangle in the oriented input image's top-left coordinate space.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `float`
  `getHeight()`
  `float`
  `getWidth()`
  `float`
  `getX()`
  `float`
  `getY()`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### EMPTY

    public static final VisionRect EMPTY

- ## Constructor Details

  - ### VisionRect

    public VisionRect(float x, float y, float width, float height)
    Creates a rectangle in the oriented input image's top-left coordinate space.
    Parameters:
      `x` - left coordinate
      `y` - top coordinate
      `width` - non-negative rectangle width
      `height` - non-negative rectangle height

- ## Method Details

  - ### getX

    public float getX()
    Returns:
      normalized left coordinate

  - ### getY

    public float getY()
    Returns:
      normalized top coordinate

  - ### getWidth

    public float getWidth()
    Returns:
      width as a fraction of oriented input width

  - ### getHeight

    public float getHeight()
    Returns:
      height as a fraction of oriented input height