public class Box
Wrapper for Leptonica's native BOX.
public static int INDEX_X
The index of the X coordinate within the geometry array.
public static int INDEX_Y
The index of the Y coordinate within the geometry array.
public static int INDEX_W
The index of the width within the geometry array.
public static int INDEX_H
The index of the height within the geometry array.
public Box(int x,
int y,
int w,
int h)
Creates a box with the specified geometry. All dimensions should be non-negative and specified in pixels.
x - X-coordinate of the top-left corner of the box.y - Y-coordinate of the top-left corner of the box.w - Width of the box.h - Height of the box.public long getNativeBox()
Returns a pointer to the native Box object.
public int getX()
Returns the box's x-coordinate in pixels.
public int getY()
Returns the box's y-coordinate in pixels.
public int getWidth()
Returns the box's width in pixels.
public int getHeight()
Returns the box's height in pixels.
public android.graphics.Rect getRect()
Returns an android.graphics.Rect containing the coordinates of this box.
public kotlin.Array[] getGeometry()
Returns an array containing the coordinates of this box. See INDEX_* constants for indices.
public boolean getGeometry(@Size
kotlin.Array[] geometry)
Fills an array containing the coordinates of this box. See INDEX_* constants for indices.
geometry - A 4+ element integer array to fill with coordinates.true on successpublic void recycle()
Releases resources and frees any memory associated with this Box.
protected void finalize()