Kofax Mobile SDK API Reference
|
Static Public Attributes | |
static final int | DEFAULT_LUMINANCE_THRESHOLD = 100 |
static final int | DEFAULT_TORCH_DELAY = 3 |
Protected Member Functions | |
void | checkLicense () |
void | onLayout (boolean changed, int l, int t, int r, int b) |
void | onDetachedFromWindow () |
void | onAttachedToWindow () |
Protected Attributes | |
IBus | _bus |
This class is responsible for rendering the camera preview.
ImageCaptureView | ( | Context | context | ) |
ImageCaptureView | ( | Context | context, |
AttributeSet | set | ||
) |
ImageCaptureView | ( | Context | context, |
AttributeSet | set, | ||
int | defStyle | ||
) |
final void addCameraInitializationFailedListener | ( | CameraInitializationFailedListener | listener | ) |
final void addCameraInitializationListener | ( | CameraInitializationListener | listener | ) |
final void addLevelnessListener | ( | LevelnessListener | listener | ) |
final void addOnAutoFocusResultListener | ( | AutoFocusResultListener | listener | ) |
final void addOnImageCapturedListener | ( | ImageCapturedListener | listener | ) |
final void addPreviewCallbackListener | ( | PreviewCallbackListener | listener | ) |
final void addStabilityDelayListener | ( | StabilityDelayListener | listener | ) |
final void addTorchLuminanceListener | ( | TorchLuminanceListener | listener | ) |
|
protected |
Reimplemented in BarCodeCaptureView, and LicenseCaptureView.
final void forceTakePicture | ( | ) |
Description: Forces capturing an image. Calling this method will ignore other capture constraints. This is equivalent to calling forceTakePicture(false);
NOTE: Capture will not take place while an autofocus cycle is running, but will happen once it completes, whether the camera is in focus or not.
final void forceTakePicture | ( | boolean | focusAgain | ) |
Description: Forces capturing an image after an optional additional autofocus cycle. Calling this method will ignore other capture constraints.
NOTE: Capture will not take place while an autofocus cycle is running, but will happen once it completes, whether the camera is in focus or not.
final List<Size> getAllowableImageResolutions | ( | ) |
Returns a list of supported resolutions for image capture.
The list of resolutions returned may differ depending on the value of getUseVideoFrame()
Note: This list may be different from that returned by StreamConfigurationMap methods (Camera2 API) or Camera.Parameters methods: getSupportedPictureSizes() or getSupportedPreviewSizes()
Note: There can be resolutions returned that cannot be used if the value of getUseVideoFrame() is changed
This method should not be called until after the CameraInitializationEvent is fired.
final int getDeviceDeclinationPitch | ( | ) |
Description: Returns the pitch angle that the Capture Control considers to be level.
final int getDeviceDeclinationRoll | ( | ) |
Description: Returns the roll angle that the Capture Control considers to be level.
final Flash getFlash | ( | ) |
This method should not be called until after the CameraInitializationEvent is fired.
final List<Rect> getFocusAreas | ( | ) |
Gets the current focus areas
Before using this API or setFocusAreas, apps should first call getMaxFocusAreas to know the maximum number of focus areas. If the value returned is 0, focus areas is not supported.
Focus area weight is set to 1000.
This method should not be called until after the CameraInitializationEvent is fired.
final GpsUsageLimits getGpsUsage | ( | ) |
Defaults to GpsUsageLimits#ALWAYS_USE_IF_ENABLED.
final int getImagePreviewHeight | ( | ) |
Description: Returns the height of the camera preview resolution. This property is read-only, and is automatically set to the resolution that will best fit the width and height of the ImageCaptureControl.
This method should not be called until after the CameraInitializationEvent is fired.
final int getImagePreviewWidth | ( | ) |
Description: Returns the width of the camera preview resolution. This property is read-only, and is automatically set to the resolution that will best fit the width and height of the ImageCaptureControl.
This method should not be called until after the CameraInitializationEvent is fired.
final int getLuminanceThreshold | ( | ) |
Returns the luminance level at which the torch activates when Flash is set to AUTOTORCH. Luminance level is a measure of the brightness of the color in the image. When the detected luminance level falls below this threshold property, the torch may be activated, depending on the torch delay property. The default value of this property is 100.
Android only.
final int getMaxFocusAreas | ( | ) |
Returns the device's maximum number of focusable areas.
This method should not be called until after the CameraInitializationEvent is fired.
final int getTorchDelay | ( | ) |
Returns the delay that controls when the torch activates when Flash is set to AUTOTORCH. This delay specifies the number of consecutive times the detected luminance must be below the configured threshold before activating the torch. The default value of this property is 3.
Android only.
final boolean getUseVideoFrame | ( | ) |
Whether the control is using the video frame as the captured image
ViewGroup getViewGroup | ( | ) |
final boolean isFlashSupported | ( | Flash | flash | ) |
final void muteAutoTorch | ( | ) |
When Flash is set to AUTOTORCH, the app can temporarily prevent the torch from lighting by calling this method. This might be necessary if you are attempting to capture a laminated document and activating the torch creates glare. This method can also be called when the torch is lit (via AUTOTORCH) to turn torch off and prevent it from lighting again.
Android only.
|
protected |
|
protected |
|
protected |
Layout our children
void removeAllViews | ( | ) |
final void removeCameraInitializationFailedListener | ( | CameraInitializationFailedListener | listener | ) |
final void removeCameraInitializationListener | ( | CameraInitializationListener | listener | ) |
final void removeLevelnessListener | ( | LevelnessListener | listener | ) |
final void removeOnAutoFocusResultListener | ( | AutoFocusResultListener | listener | ) |
final void removeOnImageCapturedListener | ( | ImageCapturedListener | listener | ) |
final void removePreviewCallbackListener | ( | PreviewCallbackListener | listener | ) |
final void removeStabilityDelayListener | ( | StabilityDelayListener | listener | ) |
final void removeTorchLuminanceListener | ( | TorchLuminanceListener | listener | ) |
final synchronized void sessionCreate | ( | ) |
final synchronized void sessionDismiss | ( | ) |
final void setCameraType | ( | CameraType | cameraType | ) |
Sets the desire camera type for image capture view. The default cameraType will be BACK_CAMERA.
cameraType | the camera type. |
final void setDeviceDeclinationPitch | ( | int | angle | ) |
Description: Sets the pitch declination of the device, which affects how far it must be tilted along the y axis of the phone in order to be considered level. By default, this is set to 0, which is considered to be the levelness of a device laying flat on its back and facing upwards.
angle | An integer value between -180 and 180. |
final void setDeviceDeclinationRoll | ( | int | angle | ) |
Description: Sets the roll declination of the device, which affects how far it must be tilted along the x axis of the phone in order to be considered level. By default, this is set to 0, which is considered to be the levelness of a device laying flat on its back and facing upwards.
angle | An integer value between -180 and 180. |
final void setFlash | ( | Flash | flash | ) |
This method will attempt to set the camera flash mode to the mode specified. It polls the camera for the flash modes the hardware allows; if the flash parameter given is not included in the supported flash modes, this method will throw an exception.
This method must not be called until after the CameraInitializationEvent is fired. An IllegalStateException is thrown if this method is called when the camera is not open.
flash | A Flash enum that corresponds to various flash modes |
final void setFocusAreas | ( | List< Rect > | focusAreas | ) | throws KmcRuntimeException |
Sets the focus areas for the control.
Before using this API or getFocusAreas, apps should first call getMaxFocusAreas to know the maximum number of focus areas. If the value returned is 0, focus areas is not supported.
Image capture focus area bounds have valid values (0,0) to a maximum of (viewWidth, viewHeight) which are then translated to valid Android focus area coordinates.
When a focus area is set that has bounds outside of the view bounds the focus area rectangle will be clamped to the nearest valid view bound.
The width and height of focus areas cannot be 0 or negative. Any Rect in the list passed in must follow the left < right, and top < bottom rule or a KmcRuntimeException will be thrown as this is an invalid focus area Rect.
A Rect in the list will also need to have a sufficient area to provide the underlying camera autofocus algorithm enough information to focus on that area. Creating a Rect that has width and height that is between 5-10% of the width and height of the preview view size is recommended. When the Rect area is too small it is likely, but this is highly device dependent, that the camera will use the entire view as the focus area.
This method should not be called until after the CameraInitializationEvent is fired.
focusAreas | A list of Rect objects representing the desired focus areas |
KmcRuntimeException | If invalid Rect |
final void setGpsUsage | ( | GpsUsageLimits | limits | ) |
Description: Calling this with a value of GpsUsageLimits#ALWAYS_USE_IF_ENABLED will cause the control to embed GPS coordinates in the captured image if Location Services are enabled. A value of GpsUsageLimits#NEVER_USE will prevent the inclusion of GPS coordinates in captured images, regardless of the availability of Location Services.
Defaults to GpsUsageLimits#ALWAYS_USE_IF_ENABLED.
final void setImageResolution | ( | Size | resolution | ) |
Sets the desired resolution for image capture. The actual resolution of a captured image may be reversed from what is given (e.g. a 960x1280 image may be returned for a 1280x960 request).
The resolution parameter must be one of the given resolutions returned from getAllowableImageResolutions()
After calling this method, the ImageCaptureView instance may resize itself.
This method should not be called until after the CameraInitializationEvent is fired.
resolution | a Size, one of those returned by getAllowableImageResolutions() |
final void setLuminanceThreshold | ( | int | luminanceThreshold | ) |
This method sets the luminance level (> 0) at which the torch activates when Flash is set to AUTOTORCH. Luminance level is a measure of the brightness of the color in the image. When the detected luminance level falls below this threshold property, the torch may be activated, depending on the torch delay property. The default value of this property is 100.
Android only.
luminanceThreshold | An integer that specifies the luminance threshold |
final void setTorchDelay | ( | int | torchDelay | ) |
This method sets the delay (> 0) that controls when the torch activates when Flash is set to AUTOTORCH. This delay specifies the number of consecutive times the detected luminance must be below the configured threshold before activating the torch. The default value of this property is 3.
Android only.
torchDelay | An integer that specifies the delay |
final void setUseVideoFrame | ( | boolean | useVideo | ) |
Description: Calling this with a value of true will cause the control to return the video frame when takePicture() is called, or when requirements are met. The video frame will normally be of lower resolution and may not be appropriate for image processing.
Defaults to false.
useVideo | whether to use preview frames for capture or not |
void surfaceChanged | ( | SurfaceHolder | holder, |
int | format, | ||
int | width, | ||
int | height | ||
) |
void surfaceCreated | ( | SurfaceHolder | holder | ) |
void surfaceDestroyed | ( | SurfaceHolder | holder | ) |
final void unmuteAutoTorch | ( | ) |
When Flash is set to AUTOTORCH, the app can temporarily prevent the torch from lighting by calling muteAutoTorch(). Call this method to revert the auto torch functionality to configured behavior.
Android only.
|
protected |
|
static |
|
static |