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 Details

  • 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