ImageRect Class
data class ImageRect(val left: Float, val top: Float, val right: Float, val bottom: Float)
A rectangle in image coordinates, independent of any Android or Compose geometry type.
The recognition surfaces report regions with this rather than with RectF or Compose’s Rect, so the same value can be handed to either without conversion at the boundary. Coordinates are in the image’s own pixels, with the origin at its top left.
Parameters
- left — the left edge, in image pixels.
- top — the top edge, in image pixels.
- right — the right edge, in image pixels.
- bottom — the bottom edge, in image pixels.
Constructors
ImageRect
constructor(left: Float, top: Float, right: Float, bottom: Float)
Types
Companion
object Companion
The empty rectangle.
Properties
bottom
val bottom: Float
isEmpty
val isEmpty: Boolean
Whether this rectangle is the zero-sized Empty, which is what the recognition surfaces report when they have no region to point at.
left
val left: Float
right
val right: Float
top
val top: Float