Kofax Mobile SDK API Reference
Classes | Public Member Functions | List of all members
ImageProcessor Class Reference

The ImageProcessor is the image processing engine. More...

Classes

class  AnalysisCompleteEvent
 An event that indicates that image quick analysis results are available. More...
 
interface  AnalysisCompleteListener
 The listener interface for receiving analysis complete events. More...
 
class  AnalysisProgressEvent
 An event that indicates Image processing progress information is available. More...
 
interface  AnalysisProgressListener
 The listener interface for receiving Analysis Progress events. More...
 
class  ImageOutEvent
 An event that indicates a processed Image is available. More...
 
interface  ImageOutListener
 The listener interface for receiving Image Out events. More...
 
class  ProcessProgressEvent
 An event that indicates Image processing progress information is available. More...
 
interface  ProcessProgressListener
 The listener interface for receiving Process Progress events. More...
 

Public Member Functions

void cancel ()
 Cancels an image processing operation that is in progress. More...
 
 ImageProcessor ()
 Public constructor allows instantiation from other classes. More...
 
void doCleanup ()
 Clean up local objects. More...
 
ImagePerfectionProfile getImagePerfectionProfile ()
 Get the ImagePerfectionProfile (advanced image processing settings). More...
 
void setImagePerfectionProfile (ImagePerfectionProfile imagePerfectionProfile)
 Set the ImagePerfectionProfile (advanced image processing settings). More...
 
BasicSettingsProfile getBasicSettingsProfile ()
 Get the BasicSettingsProfile (basic image processing settings). More...
 
void setBasicSettingsProfile (BasicSettingsProfile basicSettingsProfile)
 Set the BasicSettingsProfile (basic image processing settings). More...
 
ImageRep getProcessedImageRepresentation ()
 Get the image representation (file, bitmap, or both) for the output image. More...
 
void setProcessedImageRepresentation (ImageRep processedImageRepresentation)
 Set the image representation (file, bitmap, or both) for the output image. More...
 
String getProcessedImageFilePath ()
 Get the output image file path. More...
 
void setProcessedImageFilePath (String processedImageFilePath)
 Set the output image file path. More...
 
ImageMimeType getProcessedImageMimeType ()
 Get the output image mime type. More...
 
void setProcessedImageMimeType (ImageMimeType processedImageMimeType)
 Set the output image mime type. More...
 
int getProcessedImageJpegQuality ()
 Get the output image JPEG quality. More...
 
void setProcessedImageJpegQuality (int processedImageJpegQuality)
 Set the output image JPEG quality. More...
 
ListenerCallbackThreadType getListenerCallbackThreadType ()
 Get the ListenerCallbackThreadType. More...
 
void setListenerCallbackThreadType (ListenerCallbackThreadType listenerCallbackThreadType)
 Set the thread type for asynchronous callbacks. More...
 
void processImage (Image image) throws KmcException
 Performs image processing for the specified Image. More...
 
void processImage (Image image, ImageProcessorConfiguration configuration) throws KmcException
 Performs image processing for the specified Image. More...
 
void addImageOutEventListener (ImageOutListener listener)
 Adds the specified ImageOutListener to receive Image out events from the ImageProcessor. More...
 
void removeImageOutEventListener (ImageOutListener listener)
 Removes the specified ImageOutListener from the ImageProcessor. More...
 
void addProcessProgressEventListener (ProcessProgressListener listener)
 Adds the specified ProcessProgressListener to receive ProcessProgress events from the ImageProcessor. More...
 
void removeProcessProgressEventListener (ProcessProgressListener listener)
 Removes the specified ProcessProgressListener from the ImageProcessor. More...
 
void doQuickAnalysis (Image image, boolean returnPreviewImage) throws KmcException
 Performs image quality checks and detects the page boundaries for the specified image. More...
 
void doQuickAnalysis (Image image, boolean returnPreviewImage, QuickAnalysisSettings settings) throws KmcException
 Performs image quality checks and detects the page boundaries for the specified image. More...
 
void addAnalysisCompleteEventListener (AnalysisCompleteListener listener)
 Adds the specified AnalysisCompleteListener to receive AnalysisComplete events from the ImageProcessor. More...
 
void removeAnalysisCompleteEventListener (AnalysisCompleteListener listener)
 Removes the specified AnalysisCompleteListener from the ImageProcessor. More...
 
void addAnalysisProgressEventListener (AnalysisProgressListener listener)
 Adds the specified AnalysisProgressListener to receive AnalysisProgress events from the ImageProcessor. More...
 
void removeAnalysisProgressEventListener (AnalysisProgressListener listener)
 Removes the specified AnalysisProgressListener from the ImageProcessor. More...
 

Detailed Description

The ImageProcessor is the image processing engine.

The ImageProcessor object is an image processing engine that can process a single image according to settings contained in ImageProcessingConfiguration object. The output of the processImage(Image, ImageProcessorConfiguration) is a new instance of an Image object which contains the fully processed image.

Constructor & Destructor Documentation

Public constructor allows instantiation from other classes.

Note
Multiple instances are not allowed to be used concurrently.

Member Function Documentation

void addAnalysisCompleteEventListener ( AnalysisCompleteListener  listener)

Adds the specified AnalysisCompleteListener to receive AnalysisComplete events from the ImageProcessor.

void addAnalysisProgressEventListener ( AnalysisProgressListener  listener)

Adds the specified AnalysisProgressListener to receive AnalysisProgress events from the ImageProcessor.

void addImageOutEventListener ( ImageOutListener  listener)

Adds the specified ImageOutListener to receive Image out events from the ImageProcessor.

void addProcessProgressEventListener ( ProcessProgressListener  listener)

Adds the specified ProcessProgressListener to receive ProcessProgress events from the ImageProcessor.

void cancel ( )

Cancels an image processing operation that is in progress.

This operation is asynchronous. The ImageOutEvent will indicate that the operation was canceled using the ErrorInfo#KMC_EV_CANCEL_OPERATION_SUCCESS status.

If the processing has already completed or has not started yet this method has no effect.

void doCleanup ( )

Clean up local objects.

Call this method right before setting your ImageProcessor object to null. After calling this method, your ImageProcessor object is no longer usable.

void doQuickAnalysis ( Image  image,
boolean  returnPreviewImage 
) throws KmcException

Performs image quality checks and detects the page boundaries for the specified image.

The doQuickAnalysis method performs image quality checks and detects the page boundaries for the specified input Image object, populates the imageQuickAnalysisFeedback property in the input Image, and fires the analysisCompleteEvent. If returnPreviewImage is true, the viewBoundariesImage property of the QuickAnalysisFeedback object is updated with the preview Bitmap which shows the found page boundaries drawn in green. Calling doQuickAnalysis while image processing or analysis is still ongoing will result in a KMC_EV_PROCESS_PAGE_BUSY KmcException.

Parameters
imageThe image to be analyzed
returnPreviewImageis a boolean. If returnPreviewImage is true, the viewBoundariesImage property of the QuickAnalysisFeedback object is updated with the preview Bitmap which shows the found page boundaries drawn in green.
Exceptions
NullPointerException('image' parameter is null).
KmcException(KMC_EV_PROCESS_PAGE_BUSY).
KmcException(KMC_ED_NONEXISTENT_FILE).
KmcRuntimeException(KMC_ED_FILEPATH).

See also: AnalysisCompleteListener, AnalysisProgressListener

void doQuickAnalysis ( Image  image,
boolean  returnPreviewImage,
QuickAnalysisSettings  settings 
) throws KmcException

Performs image quality checks and detects the page boundaries for the specified image.

The doQuickAnalysis method performs image quality checks and detects the page boundaries for the specified input Image object, populates the imageQuickAnalysisFeedback property in the input Image, and fires the analysisCompleteEvent. If returnPreviewImage is true, the viewBoundariesImage property of the QuickAnalysisFeedback object is updated with the preview Bitmap which shows the found page boundaries drawn in green. Calling doQuickAnalysis while image processing or analysis is still ongoing will result in a KMC_EV_PROCESS_PAGE_BUSY KmcException.

Parameters
imageThe image to be analyzed
returnPreviewImageis a boolean. If returnPreviewImage is true, the viewBoundariesImage property of the QuickAnalysisFeedback object is updated with the preview Bitmap which shows the found page boundaries drawn in green.
settingsa QuickAnalysisSettings class used for quick analysis algorithm setting adjustment
Exceptions
NullPointerException('image' parameter is null).
KmcException(KMC_EV_PROCESS_PAGE_BUSY).
KmcException(KMC_ED_NONEXISTENT_FILE).
KmcRuntimeException(KMC_ED_FILEPATH).

See also: AnalysisCompleteListener, AnalysisProgressListener

BasicSettingsProfile getBasicSettingsProfile ( )

Get the BasicSettingsProfile (basic image processing settings).

Returns
the BasicSettingsProfile
Deprecated:
Deprecated in SDK 3.3. BasicSettingsProfile is replaced by ImageProcessorConfiguration.
ImagePerfectionProfile getImagePerfectionProfile ( )

Get the ImagePerfectionProfile (advanced image processing settings).

Returns
the ImagePerfectionProfile
Deprecated:
Deprecated in SDK 3.3. ImagePerfectionProfile is replaced by ImageProcessorConfiguration.
ListenerCallbackThreadType getListenerCallbackThreadType ( )

Get the ListenerCallbackThreadType.

Returns
the thread type for asynchronous callbacks
String getProcessedImageFilePath ( )

Get the output image file path.

Returns
the output image file path
int getProcessedImageJpegQuality ( )

Get the output image JPEG quality.

The output image JPEG quality specifies the JPEG quality for an output image file created by image processing. This is used only when both the following are true:

processedImageMimeType is set to ImageMimeType.MIMETYPE_JPEG, and
processedImageRepresentation is set to ImageRep.IMAGE_REP_FILE or ImageRep.IMAGE_REP_BOTH.

Returns
the output image JPEG quality
ImageMimeType getProcessedImageMimeType ( )

Get the output image mime type.

This property is used only when (1) processedImageFilePath property contains a valid image path, and (2) processedImageRepresentation is ImageRep.IMAGE_REP_FILE or ImageRep.IMAGE_REP_BOTH.

Returns
the output image mime type
ImageRep getProcessedImageRepresentation ( )

Get the image representation (file, bitmap, or both) for the output image.

Returns
the ProcessedImageRepresentation
void processImage ( Image  image) throws KmcException

Performs image processing for the specified Image.

The processImage method performs image processing for the specified Image and asynchronously returns a processed Image object. Processing is controlled by the properties that have been set. This method returns progress updates on such things as the status of the image processing.

Any errors detected during asynchronous processing are returned via the ImageOut event. For example, KMC_EV_PROCESS_PAGE_BUSY indicates processImage was called while image processing or analysis is still ongoing.

Parameters
imageThe image to be processed
Exceptions
NullPointerException('image' parameter is null).
KmcRuntimeException(KMC_IP_NO_PROFILE).
KmcRuntimeException(KMC_ED_NOIMAGE).
KmcRuntimeException(KMC_ED_FILEPATH).
KmcRuntimeException(KMC_ED_MIMETYPE).
KmcRuntimeException(KMC_ED_IMAGE_PERFECTION_PROFILE_EMPTY).
KmcException(KMC_ED_NONEXISTENT_FILE).
Deprecated:
Deprecated in SDK 3.3. Replaced by processImage(Image, ImageProcessorConfiguration)
void processImage ( Image  image,
ImageProcessorConfiguration  configuration 
) throws KmcException

Performs image processing for the specified Image.

Performs image processing for the specified Image and asynchronously returns a processed Image object. Processing is controlled by the properties that have been set. This method returns progress updates on such things as the status of the image processing.

Any errors detected during asynchronous processing are returned via the ImageOut event. For example, KMC_EV_PROCESS_PAGE_BUSY indicates the method was called while image processing or analysis is still ongoing.

Parameters
imageThe image to be processed
configurationThe configuration to process the image.
Exceptions
NullPointerException('image' parameter is null).
KmcRuntimeException(KMC_IP_NO_PROFILE).
KmcRuntimeException(KMC_ED_NOIMAGE).
KmcRuntimeException(KMC_ED_FILEPATH).
KmcRuntimeException(KMC_ED_MIMETYPE).
KmcRuntimeException(KMC_ED_IMAGE_PERFECTION_PROFILE_EMPTY).
KmcException(KMC_ED_NONEXISTENT_FILE).
void removeAnalysisCompleteEventListener ( AnalysisCompleteListener  listener)

Removes the specified AnalysisCompleteListener from the ImageProcessor.

void removeAnalysisProgressEventListener ( AnalysisProgressListener  listener)

Removes the specified AnalysisProgressListener from the ImageProcessor.

void removeImageOutEventListener ( ImageOutListener  listener)

Removes the specified ImageOutListener from the ImageProcessor.

void removeProcessProgressEventListener ( ProcessProgressListener  listener)

Removes the specified ProcessProgressListener from the ImageProcessor.

void setBasicSettingsProfile ( BasicSettingsProfile  basicSettingsProfile)

Set the BasicSettingsProfile (basic image processing settings).

Deskew option applies to image with skew angle less or equal to 15 degrees.

If imagePerfectionProfile is set (not null) it takes precedence over basicSettingsProfile.

Deprecated:
Deprecated in SDK 3.3. Please use ImageProcessorConfiguration as an argument for calling processImage(Image, ImageProcessorConfiguration)
void setImagePerfectionProfile ( ImagePerfectionProfile  imagePerfectionProfile)

Set the ImagePerfectionProfile (advanced image processing settings).

Set the advanced image processing settings.

Deprecated:
Deprecated in SDK 3.3. Please use ImageProcessorConfiguration as an argument for calling processImage(Image, ImageProcessorConfiguration)
void setListenerCallbackThreadType ( ListenerCallbackThreadType  listenerCallbackThreadType)

Set the thread type for asynchronous callbacks.

Defaults to ListenerCallbackThreadType#UI_THREAD.

Parameters
listenerCallbackThreadTypethe thread type for asynchronous callbacks
void setProcessedImageFilePath ( String  processedImageFilePath)

Set the output image file path.

void setProcessedImageJpegQuality ( int  processedImageJpegQuality)

Set the output image JPEG quality.

The output image JPEG quality specifies the JPEG quality for an output image file created by image processing. This is used only when both the following are true:

processedImageMimeType is set to ImageMimeType.MIMETYPE_JPEG, and
processedImageRepresentation is set to ImageRep.IMAGE_REP_FILE or ImageRep.IMAGE_REP_BOTH.

Exceptions
KmcRuntimeException(KMC_ED_INVALID_JPEG_QUALITY_VALUE).
void setProcessedImageMimeType ( ImageMimeType  processedImageMimeType)

Set the output image mime type.

This property is used only when (1) processedImageFilePath property contains a valid image path, and (2) processedImageRepresentation is ImageRep.IMAGE_REP_FILE or ImageRep.IMAGE_REP_BOTH.

void setProcessedImageRepresentation ( ImageRep  processedImageRepresentation)

Set the image representation (file, bitmap, or both) for the output image.


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.