Class ImageFrame

java.lang.Object
com.microblink.blinkid.image.ImageFrame
All Implemented Interfaces:
com.microblink.blinkid.hardware.camera.frame.ICameraFrame, com.microblink.blinkid.util.pool.PoolObject

public class ImageFrame extends Object implements com.microblink.blinkid.hardware.camera.frame.ICameraFrame
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected InputImage
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImageFrame(InputImage image, boolean treatAsVideoFrame, long id)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Finalization method.
    com.microblink.blinkid.hardware.camera.CameraDataFormat
    returns the format of the frame
    final long
    Returns the unique frame identifier
    final double
    Returns the quality of the current frame.
    final int
    returns the height of the frame
    final long
    Accessed from native code to obtain pointer to implementation of native camera frame
    Returns the orientation of the current frame.
    final android.graphics.RectF
    returns the region that defines the visible part of frame
    final int
    returns the width of the frame
    boolean
    initializeNativePart(long frameAnalyzersPtr)
    Initializes native part of camera frame implementation.
    final void
    Initialization method.
    final boolean
    returns true if device was moving while frame was created
    final boolean
    returns true if camera thinks this frame is focused
    final boolean
    Returns true if frame is photograph
    void
    Used for recycling frame buffer back into camera so its buffer can be reused for new camera frame.
    final void
    Sets the orientation of the current frame.
    final void
    setVisiblePart(android.graphics.RectF visiblePart)
    sets the region that defines the visible part of frame

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ImageFrame

      public ImageFrame(@Nullable InputImage image, boolean treatAsVideoFrame, long id)
  • Method Details

    • getWidth

      public final int getWidth()
      returns the width of the frame
      Specified by:
      getWidth in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • getHeight

      public final int getHeight()
      returns the height of the frame
      Specified by:
      getHeight in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • setVisiblePart

      public final void setVisiblePart(@NonNull android.graphics.RectF visiblePart)
      sets the region that defines the visible part of frame
      Specified by:
      setVisiblePart in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      Parameters:
      visiblePart -
    • getFormat

      @NonNull public com.microblink.blinkid.hardware.camera.CameraDataFormat getFormat()
      Description copied from interface: com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      returns the format of the frame
      Specified by:
      getFormat in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • isFocused

      public final boolean isFocused()
      returns true if camera thinks this frame is focused
      Specified by:
      isFocused in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • isDeviceMoving

      public final boolean isDeviceMoving()
      returns true if device was moving while frame was created
      Specified by:
      isDeviceMoving in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • getVisiblePart

      @NonNull public final android.graphics.RectF getVisiblePart()
      returns the region that defines the visible part of frame
      Specified by:
      getVisiblePart in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • isPhoto

      public final boolean isPhoto()
      Returns true if frame is photograph
      Specified by:
      isPhoto in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • initializeNativePart

      public boolean initializeNativePart(long frameAnalyzersPtr)
      Description copied from interface: com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      Initializes native part of camera frame implementation. This makes getNativeCameraFrame available.
      Specified by:
      initializeNativePart in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      Parameters:
      frameAnalyzersPtr - Native pointer to class containing all native elements frame needs (frame quality estimator, white balance analyzer etc.)
      Returns:
      true on success, false on failure.
    • recycle

      public void recycle()
      Description copied from interface: com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      Used for recycling frame buffer back into camera so its buffer can be reused for new camera frame. Also, releases all native part if required.
      Specified by:
      recycle in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • getNativeCameraFrame

      public final long getNativeCameraFrame()
      Accessed from native code to obtain pointer to implementation of native camera frame
      Specified by:
      getNativeCameraFrame in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • getFrameQuality

      public final double getFrameQuality()
      Returns the quality of the current frame. Negative quality indicates that quality is not and cannot be calculated.
      Specified by:
      getFrameQuality in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • setOrientation

      public final void setOrientation(@NonNull Orientation orientation)
      Sets the orientation of the current frame.
      Specified by:
      setOrientation in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
      Parameters:
      orientation -
    • getOrientation

      @NonNull public final Orientation getOrientation()
      Returns the orientation of the current frame.
      Specified by:
      getOrientation in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • getFrameID

      public final long getFrameID()
      Returns the unique frame identifier
      Specified by:
      getFrameID in interface com.microblink.blinkid.hardware.camera.frame.ICameraFrame
    • initializePoolObject

      public final void initializePoolObject()
      Initialization method. Called when an object is retrieved from the object pool or has just been created.
      Specified by:
      initializePoolObject in interface com.microblink.blinkid.util.pool.PoolObject
    • finalizePoolObject

      public final void finalizePoolObject()
      Finalization method. Called when an object is stored in the object pool to mark it as free.
      Specified by:
      finalizePoolObject in interface com.microblink.blinkid.util.pool.PoolObject