Kofax Mobile SDK API 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... | |
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.
ImageProcessor | ( | ) |
Public constructor allows instantiation from other classes.
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.
image | The image to be analyzed |
returnPreviewImage | is 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. |
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.
image | The image to be analyzed |
returnPreviewImage | is 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. |
settings | a QuickAnalysisSettings class used for quick analysis algorithm setting adjustment |
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).
ImagePerfectionProfile getImagePerfectionProfile | ( | ) |
Get the ImagePerfectionProfile (advanced image processing settings).
ListenerCallbackThreadType getListenerCallbackThreadType | ( | ) |
Get the ListenerCallbackThreadType.
String getProcessedImageFilePath | ( | ) |
Get 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.
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.
ImageRep getProcessedImageRepresentation | ( | ) |
Get the image representation (file, bitmap, or both) for the output image.
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.
image | The image to be processed |
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 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.
image | The image to be processed |
configuration | The configuration to process the image. |
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.
void setImagePerfectionProfile | ( | ImagePerfectionProfile | imagePerfectionProfile | ) |
Set the ImagePerfectionProfile (advanced image processing settings).
Set the advanced image processing settings.
void setListenerCallbackThreadType | ( | ListenerCallbackThreadType | listenerCallbackThreadType | ) |
Set the thread type for asynchronous callbacks.
Defaults to ListenerCallbackThreadType#UI_THREAD.
listenerCallbackThreadType | the 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.
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.