Package 

Class Box


  • 
    public class Box
    
                        

    Wrapper for Leptonica's native BOX.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int INDEX_X
      public final static int INDEX_Y
      public final static int INDEX_W
      public final static int INDEX_H
    • Constructor Summary

      Constructors 
      Constructor Description
      Box(int x, int y, int w, int h) Creates a box with the specified geometry.
    • Method Summary

      Modifier and Type Method Description
      long getNativeBox() Returns a pointer to the native Box object.
      int getX() Returns the box's x-coordinate in pixels.
      int getY() Returns the box's y-coordinate in pixels.
      int getWidth() Returns the box's width in pixels.
      int getHeight() Returns the box's height in pixels.
      Rect getRect() Returns an android.graphics.Rect containing the coordinatesof this box.
      Array<int> getGeometry() Returns an array containing the coordinates of this box.
      boolean getGeometry(@Size(min = 4) Array<int> geometry) Fills an array containing the coordinates of this box.
      void recycle() Releases resources and frees any memory associated with this Box.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Box

        Box(int x, int y, int w, int h)
        Creates a box with the specified geometry.
        Parameters:
        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.
    • Method Detail

      • getNativeBox

         long getNativeBox()

        Returns a pointer to the native Box object.

      • getX

         int getX()

        Returns the box's x-coordinate in pixels.

      • getY

         int getY()

        Returns the box's y-coordinate in pixels.

      • getWidth

         int getWidth()

        Returns the box's width in pixels.

      • getHeight

         int getHeight()

        Returns the box's height in pixels.

      • getGeometry

         Array<int> getGeometry()

        Returns an array containing the coordinates of this box. See INDEX_*constants for indices.

      • getGeometry

         boolean getGeometry(@Size(min = 4) Array<int> geometry)

        Fills an array containing the coordinates of this box. See INDEX_*constants for indices.

        Parameters:
        geometry - A 4+ element integer array to fill with coordinates.
      • recycle

         void recycle()

        Releases resources and frees any memory associated with this Box.