Class ImageFrame

  • All Implemented Interfaces:
    com.microblink.hardware.camera.frame.ICameraFrame, com.microblink.util.pool.PoolObject

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

      Fields 
      Modifier and Type Field Description
      protected Image mImage  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finalizePoolObject()
      Finalization method.
      com.microblink.hardware.camera.CameraDataFormat getFormat()
      returns the format of the frame
      long getFrameID()
      Returns the unique frame identifier
      double getFrameQuality()
      Returns the quality of the current frame.
      int getHeight()
      returns the height of the frame
      long getNativeCameraFrame()
      Accessed from native code to obtain pointer to implementation of native camera frame
      Orientation getOrientation()
      Returns the orientation of the current frame.
      android.graphics.RectF getVisiblePart()
      returns the region that defines the visible part of frame
      int getWidth()
      returns the width of the frame
      boolean initializeNativePart​(long frameAnalyzersPtr)
      Initializes native part of camera frame implementation.
      void initializePoolObject()
      Initialization method.
      boolean isDeviceMoving()
      returns true if device was moving while frame was created
      boolean isFocused()
      returns true if camera thinks this frame is focused
      boolean isPhoto()
      Returns true if frame is photograph
      void recycle()
      Used for recycling frame buffer back into camera so its buffer can be reused for new camera frame.
      void setOrientation​(Orientation orientation)
      Sets the orientation of the current frame.
      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 Detail

      • mImage

        @NonNull
        protected Image mImage
    • Constructor Detail

      • ImageFrame

        public ImageFrame​(@Nullable
                          Image image,
                          boolean treatAsVideoFrame,
                          long id)
    • Method Detail

      • getWidth

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

        public final int getHeight()
        returns the height of the frame
        Specified by:
        getHeight in interface com.microblink.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.hardware.camera.frame.ICameraFrame
        Parameters:
        visiblePart -
      • getFormat

        @NonNull
        public com.microblink.hardware.camera.CameraDataFormat getFormat()
        Description copied from interface: com.microblink.hardware.camera.frame.ICameraFrame
        returns the format of the frame
        Specified by:
        getFormat in interface com.microblink.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.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.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.hardware.camera.frame.ICameraFrame
      • isPhoto

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

        public boolean initializeNativePart​(long frameAnalyzersPtr)
        Description copied from interface: com.microblink.hardware.camera.frame.ICameraFrame
        Initializes native part of camera frame implementation. This makes getNativeCameraFrame available.
        Specified by:
        initializeNativePart in interface com.microblink.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.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.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.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.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.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.hardware.camera.frame.ICameraFrame
      • getFrameID

        public final long getFrameID()
        Returns the unique frame identifier
        Specified by:
        getFrameID in interface com.microblink.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.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.util.pool.PoolObject