Kofax Mobile SDK API Reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DocumentBaseCaptureExperience Class Referenceabstract
Inheritance diagram for DocumentBaseCaptureExperience:
CaptureExperience StabilityDelayListener LevelnessListener AutoFocusResultListener ImageCapturedListener CheckCaptureExperience DocumentCaptureExperience FixedAspectRatioCaptureExperience PassportCaptureExperience

Public Member Functions

 DocumentBaseCaptureExperience (ImageCaptureView view, DocumentBaseCaptureExperienceCriteriaHolder criteria)
 
final void addOnImageCapturedListener (ImageCapturedListener listener)
 
final void removeOnImageCapturedListener (ImageCapturedListener listener)
 
final void addAboutToCaptureListener (AboutToCaptureListener listener)
 
final void removeAboutToCaptureListener (AboutToCaptureListener listener)
 
final void addJustCapturedListener (JustCapturedListener listener)
 
final void removeJustCapturedListener (JustCapturedListener listener)
 
final void addOnImageCapturedEventListener (ImageCapturedEventListener listener)
 
final void removeOnImageCapturedEventListener (ImageCapturedEventListener listener)
 
final void setVibrationEnabled (boolean enable)
 Manage vibration after an image is captured. More...
 
boolean isVibrationEnabled ()
 
final void setDiagnosticsViewEnabled (boolean enabled)
 
boolean isDiagnosticsViewEnabled ()
 
void takePicture ()
 
void takePictureContinually ()
 
void stopCapture ()
 
void destroy ()
 
void enableAnimationTutor (boolean enable)
 Sets whether or not to show an animated tutorial about how to capture a document. More...
 
boolean isAnimationTutorEnable ()
 
CaptureMessage getUserInstructionMessage ()
 
void setUserInstructionMessage (CaptureMessage userInstructionsMessage)
 
CaptureMessage getTutorialDismissMessage ()
 
void setTutorialDismissMessage (CaptureMessage tutorialDismissMessage)
 
CaptureMessage getHoldSteadyMessage ()
 
void setHoldSteadyMessage (CaptureMessage holdSteadyMessage)
 
void setCenterMessage (CaptureMessage centerMessage)
 
CaptureMessage getCenterMessage ()
 
void setZoomInMessage (CaptureMessage zoomInMessage)
 
CaptureMessage getZoomInMessage ()
 
void setZoomOutMessage (CaptureMessage zoomOutMessage)
 
CaptureMessage getZoomOutMessage ()
 
void setRotateMessage (CaptureMessage message)
 
CaptureMessage getRotateMessage ()
 
void setHoldParallelMessage (CaptureMessage message)
 
CaptureMessage getHoldParallelMessage ()
 
void setTiltUpDeviceMessage (CaptureMessage message)
 
void setTiltForwardDeviceMessage (CaptureMessage message)
 
CaptureMessage getTiltUpDeviceMessage ()
 
CaptureMessage getTiltForwardDeviceMessage ()
 
void setCapturedMessage (CaptureMessage capturedMessage)
 
CaptureMessage getCapturedMessage ()
 
void setOuterViewFinderColor (int colorCode)
 Outer view finder color. More...
 
int getOuterViewFinderColor ()
 
void setGuidanceFrameColor (int colorCode)
 Guidance frame color. More...
 
void setSteadyGuidanceFrameColor (int colorCode)
 Steady guidance frame color. More...
 
int getGuidanceFrameColor ()
 
void setGuidanceFrameThickness (int width)
 Guidance frame Thickness. More...
 
int getGuidanceFrameThickness ()
 
Bitmap getDocumentSampleImage ()
 
void setDocumentSampleImage (Bitmap documentSampleImage)
 
void addPageDetectionListener (PageDetectionListener listener)
 
void removePageDetectionListener (PageDetectionListener listener)
 
- Public Member Functions inherited from CaptureExperience
void addOnImageCapturedListener (ImageCapturedListener listener)
 
void removeOnImageCapturedListener (ImageCapturedListener listener)
 
void setVibrationEnabled (boolean enable)
 
boolean isVibrationEnabled ()
 
void takePicture ()
 
void takePictureContinually ()
 
void stopCapture ()
 
void onImageCaptured (ImageCapturedEvent event)
 Invoked when the camera captures an image. More...
 
void onAutoFocus (AutoFocusResultEvent event)
 Invoked when the camera completes focusing. More...
 
void onLevelness (LevelnessEvent event)
 Invoked when the orientation of the device changes. More...
 
void onStabilityDelay (StabilityDelayEvent event)
 Invoked when stability levels change. More...
 
void destroy ()
 

Protected Member Functions

void initBase (ImageCaptureView view, IDetectionAdapter adapter, DocumentBaseCaptureExperienceCriteriaHolder criteria)
 
- Protected Member Functions inherited from CaptureExperience
void invokeImageCapturedListeners (ImageCapturedEvent event)
 
boolean captureCriteriaMetInternal (CaptureExperienceData data)
 

Protected Attributes

Context _ctx
 
- Protected Attributes inherited from CaptureExperience
CaptureExperienceData _captureExperienceData = new CaptureExperienceData()
 
final Object _lock
 
boolean _sdkCaptureRequested
 
boolean _continuousCapture
 
ImageCaptureView _imageCaptureView
 
final Handler _uiHandler = new Handler(Looper.getMainLooper())
 
float _aspectRatio
 
Set< ImageCapturedListener_imageCapturedListeners = new LinkedHashSet<ImageCapturedListener>()
 
Vibrator _vibrator
 
boolean _vibrationEnabled = false
 

Detailed Description

This class renders an enhanced visual experience on an ImageCaptureView and provides feedback to guide the user to take a clear, legible and optimally zoomed in photo of a document. Criteria of such a document can be specified by using a setCaptureCriteria method.

A photo will be taken automatically once the specified criteria are met, and takePicture() or takePictureContinually() has been called.

Note: DocumentBaseCaptureExperience is best used on a view that occupies the maximum possible area of its parent view.

Constructor & Destructor Documentation

Note: This is best used on a view that occupies tge maximum possible area of its parent view.

Parameters
viewThe view this will be drawn onto
criteriaThe criteria used to determine when a photo should be taken. null is an acceptable value, and will give the default experience

Member Function Documentation

final void addAboutToCaptureListener ( AboutToCaptureListener  listener)

This Callback is to inform the user that image is about to be captured.

Parameters
listenerThe image about to capture listener
See also
AboutToCaptureListener
final void addJustCapturedListener ( JustCapturedListener  listener)

This Callback is to inform the user that image has been just captured.

Parameters
listenerThe image just captured listener
See also
JustCapturedListener
final void addOnImageCapturedEventListener ( ImageCapturedEventListener  listener)

Invoked after the camera captures an image and identifies glare if glare detection is enabled.

Parameters
listenerImage Captured Event Listener
See also
ImageCapturedEventListener
final void addOnImageCapturedListener ( ImageCapturedListener  listener)

Invoked after the camera captures an image and when all capture messages were shown. To allow for every message to be played, this method should be used to set an ImageCapturedListener instead of the method on the ImageCaptureView class.

Parameters
listenerThe image captured listener
See also
ImageCapturedListener
Deprecated:
Deprecated in SDK 3.5. Please use com.kofax.kmc.kui.uicontrols.captureanimations.DocumentBaseCaptureExperience#addOnImageCapturedEventListener(ImageCapturedEventListener)
void addPageDetectionListener ( PageDetectionListener  listener)

Adds a listener to be invoked when a page is detected.

Parameters
listenerthe listener
See also
PageDetectionListener
void destroy ( )

Detaches from the ImageCaptureView and destroys this experience.

void enableAnimationTutor ( boolean  enable)

Sets whether or not to show an animated tutorial about how to capture a document.

By default, the tutorial isn't shown.

Parameters
enableboolean.
CaptureMessage getCapturedMessage ( )

Returns the attributes of the message that will be displayed when a document is captured.

Default configuration:

  • message: "Done!"
  • text color: green
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 16
  • typeface: not specified
  • messageIcons: checkmark icon from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setCapturedMessage(CaptureMessage)
CaptureMessage
CaptureMessage getCenterMessage ( )

Returns the attributes of the message that is displayed when the document is not centered enough for capture.

Default configuration:

  • message: "Center Document"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 16
  • typeface: not specified
  • messageIcons: not specified
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setCenterMessage(CaptureMessage)
CaptureMessage
Bitmap getDocumentSampleImage ( )

The Bitmap of a sample document that is displayed over the document frame area when the animated tutorial is enabled.

Returns
Bitmap
See also
setDocumentSampleImage(Bitmap)
int getGuidanceFrameColor ( )

Returns the color used for the guidance frame.

Returns
The color used for the guidance frame.
int getGuidanceFrameThickness ( )

Returns the thickness value of the guidance frame line in Denisty-indepenent Pixels(dp).

Returns
The thickness value of the guidance frame line in Denisty-indepenent Pixels(dp).
CaptureMessage getHoldParallelMessage ( )

Returns the attributes of the message that will be displayed when the capture experience needs to instruct the user to hold the device more level.
The levelness thresholds can be set using the CaptureExperienceCriteriaHolder#setPitchThreshold(int) and CaptureExperienceCriteriaHolder#setRollThreshold(int) methods.

Default configuration:

  • message: "Hold Device Level"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: hold parallel icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setHoldParallelMessage(CaptureMessage)
CaptureMessage
CaptureMessage getHoldSteadyMessage ( )

Returns the attributes of the message that is displayed on the capture control to direct the user to hold the device steady so that a clear focused image can be captured. This message is shown when all the constraints are met and ready to capture.

Default configuration:

  • message: "Hold Steady"
  • text color: red
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 16
  • typeface: not specified
  • messageIcons: camera icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setHoldSteadyMessage(CaptureMessage)
CaptureMessage
int getOuterViewFinderColor ( )

Returns the color used for the outer view finder background.

Returns
The color used for the outer view finder background
CaptureMessage getRotateMessage ( )

Returns the attributes of the message that will be displayed when the capture experience needs to instruct the user to rotate the device or the document.

Default configuration:

  • message: "Rotate Device"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: change orientation icon from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setRotateMessage(CaptureMessage)
CaptureMessage
CaptureMessage getTiltForwardDeviceMessage ( )

Returns the attributes of the message that will be displayed when the capture experience needs to instruct the user to tilt the device forward a bit.
Default configuration:

  • message: "Tilt forward"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: hold parallel icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setTiltForwardDeviceMessage(CaptureMessage)
CaptureMessage
CaptureMessage getTiltUpDeviceMessage ( )

Returns the attributes of the message that will be displayed when the capture experience needs to instruct the user to tilt the device up a bit.
Default configuration:

  • message: "Tilt device up a bit"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: hold parallel icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setTiltUpDeviceMessage(CaptureMessage)
CaptureMessage
CaptureMessage getTutorialDismissMessage ( )

A property to configure the attributes of the instruction message that is displayed when the capture experience needs to instruct the user to skip tutorial demo.

The following CaptureMessage property methods are not supported for this message: getMessageIcons() / setMessageIcons(Bitmap[]).

Default configuration:

  • message: "Tap to dismiss"
  • text color: white
  • background color: transparent
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
    By default, the message is placed under the target frame if the position coordinates were not set.
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
CaptureMessage
CaptureMessage getUserInstructionMessage ( )

Returns the attributes of the instruction message that is displayed on the capture control while the user is trying to capture. This message will be displayed during periods where other guidance is not available to correct a user. This may happen in particular when the user is holding a device too far away from a document, preventing detection.

The following CaptureMessage property methods are not supported for this message: getMessageIcons() / setMessageIcons(Bitmap[]).

Default configuration:

  • message: "Fill viewable area with document"
  • text color: white
  • background color: transparent
  • background drawable: not specified
  • text size: 32
  • typeface: not specified
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
CaptureMessage
CaptureMessage getZoomInMessage ( )

Returns the attributes of the message that is displayed when the capture experience needs to instruct the user to move the device closer to the target document.

Default configuration:

  • message: "Move Closer"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: zoom in icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setZoomInMessage(CaptureMessage)
CaptureMessage
CaptureMessage getZoomOutMessage ( )

Returns the attributes of the message that will be displayed when the capture experience needs to instruct the user to move the device farther away from the target document.

Default configuration:

  • message: "Move Back"
  • text color: white
  • background color: black with 0.7 alpha component
  • background drawable: not specified
  • text size: 20
  • typeface: not specified
  • messageIcons: zoom out icons from package resource stream
    Icon is placed inside of the balloon. Its position and size depend on the balloon and text size.
    Icon will be centered inside balloon if there is no text message, otherwise it will be horizontally centered and shifted to the top.
    Icon is scaled to fit available balloon space with fixed aspect ratio.
  • orientation: CaptureMessage.KUIMessageOrientation#LANDSCAPE
  • width and height: not specified
  • position: center
  • visibility: true
Returns
CaptureMessage
See also
setZoomOutMessage(CaptureMessage)
CaptureMessage
void initBase ( ImageCaptureView  view,
IDetectionAdapter  adapter,
DocumentBaseCaptureExperienceCriteriaHolder  criteria 
)
protected
boolean isAnimationTutorEnable ( )
Returns
Whether to show animated instructions or not. False by default.
boolean isDiagnosticsViewEnabled ( )
Returns
Whether to show diagnostics view or not. False by default.
boolean isVibrationEnabled ( )
Returns
Whether or not to vibrate after an image is captured. True by default.
final void removeAboutToCaptureListener ( AboutToCaptureListener  listener)

Remove AboutToCaptureListener.

Parameters
listenerThe image about to capture listener
See also
AboutToCaptureListener
addAboutToCaptureListener(AboutToCaptureListener)
final void removeJustCapturedListener ( JustCapturedListener  listener)

Remove justCapturedListener.

Parameters
listenerThe image just captured listener
See also
JustCapturedListener
addJustCapturedListener(JustCapturedListener)
final void removeOnImageCapturedEventListener ( ImageCapturedEventListener  listener)

Remove Image Captured Event Listener

Parameters
listenerImage Captured Event Listener
See also
ImageCapturedEventListener
addOnImageCapturedEventListener(ImageCapturedEventListener)
final void removeOnImageCapturedListener ( ImageCapturedListener  listener)
void removePageDetectionListener ( PageDetectionListener  listener)

Removes page detection listener.

Parameters
listenerthe listener
void setCapturedMessage ( CaptureMessage  capturedMessage)

This message will be displayed when the document is captured.

Parameters
capturedMessage: CaptureMessage
See also
getCapturedMessage()
CaptureMessage
void setCenterMessage ( CaptureMessage  centerMessage)

This instruction will be displayed when the document is not centered enough in the target frame for capture.

Parameters
centerMessage: CaptureMessage
See also
getCenterMessage()
CaptureMessage
final void setDiagnosticsViewEnabled ( boolean  enabled)

Enables diagnostics view. Following information is logging:

  • Selected camera resolution
  • Stability value and thresholds
  • Whether it is focused
  • Focus Areas
  • Pitch/roll - values and thresholds
  • Detected page
  • Pre-crop target frame

By default, the diagnostics view isn't shown.

Parameters
enabledWhether to show diagnostics view or not
void setDocumentSampleImage ( Bitmap  documentSampleImage)

The specified Bitmap of a sample document is displayed over the document frame area when the animated tutorial is enabled. The sample document image is stretched if necessary to fill the entire document frame area. While the tutorial is running, MICR and guidance animation are superimposed over the image.

A default document sample image is used if it isn't set by the app. Inherited classes have own default sample images.

Parameters
documentSampleImage: Bitmap
See also
enableAnimationTutor(boolean)
void setGuidanceFrameColor ( int  colorCode)

Guidance frame color.

Specifies the color that will be used for the guidance frame, for example in the case of check capture. The default color is green.

void setGuidanceFrameThickness ( int  width)

Guidance frame Thickness.

Specifies the thickness of the guidance frame line in Denisty-indepenent Pixels(dp). Valid values are in the range [0, 100], values outside this range will be ignored and default width will be set. The default value is 12 dp.

void setHoldParallelMessage ( CaptureMessage  message)

This message will be displayed when the capture experience needs to instruct the user to hold the device more level.

Parameters
messageCaptureMessage
See also
getHoldParallelMessage()
CaptureMessage
void setHoldSteadyMessage ( CaptureMessage  holdSteadyMessage)

A property to configure the attributes of the message that is displayed on the capture control to direct the user to hold the device steady so that a clear focused image can be captured. This message is shown when all the constraints are met and ready to capture.

Parameters
holdSteadyMessage: CaptureMessage
See also
getHoldSteadyMessage()
CaptureMessage
void setOuterViewFinderColor ( int  colorCode)

Outer view finder color.

Specifies the color that will be used for the outer view finder background. The default color is translucent grey.

void setRotateMessage ( CaptureMessage  message)

This message will be displayed when the capture experience needs to instruct the user to rotate the device or the document.

Parameters
messageCaptureMessage
See also
getRotateMessage()
CaptureMessage
void setSteadyGuidanceFrameColor ( int  colorCode)

Steady guidance frame color.

Specifies the color that will be used for the guidance frame when control is ready to capture.

By default, it is equals to the guidanceFrameColor (green).

void setTiltForwardDeviceMessage ( CaptureMessage  message)

This message will be displayed when the capture experience needs to instruct the user to tilt the device forward a bit.

Parameters
messageCaptureMessage
See also
getTiltForwardDeviceMessage()
CaptureMessage
void setTiltUpDeviceMessage ( CaptureMessage  message)

This message will be displayed when the capture experience needs to instruct the user to tilt the device up a bit.

Parameters
messageCaptureMessage
See also
getTiltUpDeviceMessage()
CaptureMessage
void setTutorialDismissMessage ( CaptureMessage  tutorialDismissMessage)

A property to configure the attributes of the instruction message that is displayed when the capture experience needs to instruct the user to skip tutorial demo.

Parameters
tutorialDismissMessage: CaptureMessage
See also
getTutorialDismissMessage()
CaptureMessage
void setUserInstructionMessage ( CaptureMessage  userInstructionsMessage)

A property to configure the attributes of the instruction message that is displayed on the capture control while the user is trying to capture.

Parameters
userInstructionsMessage: CaptureMessage
See also
getUserInstructionMessage()
CaptureMessage
final void setVibrationEnabled ( boolean  enable)

Manage vibration after an image is captured.

Turn on/off vibration after an image is captured for haptic feedback.

Enabled by default.

Parameters
enableboolean
Note
android.permission.VIBRATE permission should also be granted to allow vibration.
void setZoomInMessage ( CaptureMessage  zoomInMessage)

This message will be displayed when the capture experience needs to instruct the user to move the device closer to the target document.

Parameters
zoomInMessage: CaptureMessage
See also
getZoomInMessage()
CaptureMessage
void setZoomOutMessage ( CaptureMessage  zoomOutMessage)

This message will be displayed when the capture experience needs to instruct the user to move the device farther away from the target document.

Parameters
zoomOutMessage: CaptureMessage
See also
getZoomOutMessage()
CaptureMessage
void stopCapture ( )

This is the counterpart to takePicture() and takePictureContinually(). Calling this method will stop automatic image capture when the criteria are satisfied.

See also
takePicture()
takePictureContinually()
void takePicture ( )

Calling this method will start the process of monitoring the capture criteria that was configured to determine when a document that meets all the criteria can be captured. The static frame will change its color to green to indicate that a document will be captured soon.

void takePictureContinually ( )

Calling this method will start the continuous capture of images. Images will automatically be captured when criteria are satisfied.

Member Data Documentation

Context _ctx
protected

The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.