Class ImageFrame
- java.lang.Object
-
- com.microblink.documentverification.image.ImageFrame
-
- All Implemented Interfaces:
com.microblink.documentverification.hardware.camera.frame.ICameraFrame,com.microblink.documentverification.util.pool.PoolObject
public class ImageFrame extends java.lang.Object implements com.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
-
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 voidfinalizePoolObject()Finalization method.com.microblink.documentverification.hardware.camera.CameraDataFormatgetFormat()returns the format of the framelonggetFrameID()Returns the unique frame identifierdoublegetFrameQuality()Returns the quality of the current frame.intgetHeight()returns the height of the framelonggetNativeCameraFrame()Accessed from native code to obtain pointer to implementation of native camera frameOrientationgetOrientation()Returns the orientation of the current frame.android.graphics.RectFgetVisiblePart()returns the region that defines the visible part of frameintgetWidth()returns the width of the framebooleaninitializeNativePart(long frameAnalyzersPtr)Initializes native part of camera frame implementation.voidinitializePoolObject()Initialization method.booleanisDeviceMoving()returns true if device was moving while frame was createdbooleanisFocused()returns true if camera thinks this frame is focusedbooleanisPhoto()Returns true if frame is photographvoidrecycle()Used for recycling frame buffer back into camera so its buffer can be reused for new camera frame.voidsetOrientation(Orientation orientation)Sets the orientation of the current frame.voidsetVisiblePart(android.graphics.RectF visiblePart)sets the region that defines the visible part of frame
-
-
-
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:
getWidthin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
getHeight
public final int getHeight()
returns the height of the frame- Specified by:
getHeightin interfacecom.microblink.documentverification.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:
setVisiblePartin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame- Parameters:
visiblePart-
-
getFormat
@NonNull public com.microblink.documentverification.hardware.camera.CameraDataFormat getFormat()
Description copied from interface:com.microblink.documentverification.hardware.camera.frame.ICameraFramereturns the format of the frame- Specified by:
getFormatin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
isFocused
public final boolean isFocused()
returns true if camera thinks this frame is focused- Specified by:
isFocusedin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
isDeviceMoving
public final boolean isDeviceMoving()
returns true if device was moving while frame was created- Specified by:
isDeviceMovingin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
getVisiblePart
@NonNull public final android.graphics.RectF getVisiblePart()
returns the region that defines the visible part of frame- Specified by:
getVisiblePartin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
isPhoto
public final boolean isPhoto()
Returns true if frame is photograph- Specified by:
isPhotoin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
initializeNativePart
public boolean initializeNativePart(long frameAnalyzersPtr)
Description copied from interface:com.microblink.documentverification.hardware.camera.frame.ICameraFrameInitializes native part of camera frame implementation. This makes getNativeCameraFrame available.- Specified by:
initializeNativePartin interfacecom.microblink.documentverification.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.documentverification.hardware.camera.frame.ICameraFrameUsed 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:
recyclein interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
getNativeCameraFrame
public final long getNativeCameraFrame()
Accessed from native code to obtain pointer to implementation of native camera frame- Specified by:
getNativeCameraFramein interfacecom.microblink.documentverification.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:
getFrameQualityin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
setOrientation
public final void setOrientation(@NonNull Orientation orientation)Sets the orientation of the current frame.- Specified by:
setOrientationin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame- Parameters:
orientation-
-
getOrientation
@NonNull public final Orientation getOrientation()
Returns the orientation of the current frame.- Specified by:
getOrientationin interfacecom.microblink.documentverification.hardware.camera.frame.ICameraFrame
-
getFrameID
public final long getFrameID()
Returns the unique frame identifier- Specified by:
getFrameIDin interfacecom.microblink.documentverification.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:
initializePoolObjectin interfacecom.microblink.documentverification.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:
finalizePoolObjectin interfacecom.microblink.documentverification.util.pool.PoolObject
-
-