Package com.microblink.image
Class ImageFrame
- java.lang.Object
-
- com.microblink.image.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
-
-
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 framelong
getFrameID()
Returns the unique frame identifierdouble
getFrameQuality()
Returns the quality of the current frame.int
getHeight()
returns the height of the framelong
getNativeCameraFrame()
Accessed from native code to obtain pointer to implementation of native camera frameOrientation
getOrientation()
Returns the orientation of the current frame.android.graphics.RectF
getVisiblePart()
returns the region that defines the visible part of frameint
getWidth()
returns the width of the frameboolean
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 createdboolean
isFocused()
returns true if camera thinks this frame is focusedboolean
isPhoto()
Returns true if frame is photographvoid
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
-
-
-
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 interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
getHeight
public final int getHeight()
returns the height of the frame- Specified by:
getHeight
in interfacecom.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 interfacecom.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 interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
isFocused
public final boolean isFocused()
returns true if camera thinks this frame is focused- Specified by:
isFocused
in interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
isDeviceMoving
public final boolean isDeviceMoving()
returns true if device was moving while frame was created- Specified by:
isDeviceMoving
in interfacecom.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 interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
isPhoto
public final boolean isPhoto()
Returns true if frame is photograph- Specified by:
isPhoto
in interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
setOrientation
public final void setOrientation(@NonNull Orientation orientation)
Sets the orientation of the current frame.- Specified by:
setOrientation
in interfacecom.microblink.hardware.camera.frame.ICameraFrame
- Parameters:
orientation
-
-
getOrientation
@NonNull public final Orientation getOrientation()
Returns the orientation of the current frame.- Specified by:
getOrientation
in interfacecom.microblink.hardware.camera.frame.ICameraFrame
-
getFrameID
public final long getFrameID()
Returns the unique frame identifier- Specified by:
getFrameID
in interfacecom.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 interfacecom.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 interfacecom.microblink.util.pool.PoolObject
-
-