Atalasoft MobileImage API Reference
Classes | Public Member Functions | List of all members
com.kofax.kmc.ken.engines.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 ()
 Log app stats dismissal time and 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 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 either an ImagePerfectionProfile object, or a BasicSettingsProfile object, but not both simultaneously. The settings in the ImagePerfectionProfile property take precedence over those in the BasicSettingsProfile property. The output of the processImage method is a new instance of an Image object which contains the fully processed image.

Constructor & Destructor Documentation

com.kofax.kmc.ken.engines.ImageProcessor.ImageProcessor ( )
inline

Public constructor allows instantiation from other classes.

Note
Multiple instances are not allowed to be used concurrently.

Member Function Documentation

void com.kofax.kmc.ken.engines.ImageProcessor.addAnalysisCompleteEventListener ( AnalysisCompleteListener  listener)
inline

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

void com.kofax.kmc.ken.engines.ImageProcessor.addAnalysisProgressEventListener ( AnalysisProgressListener  listener)
inline

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

void com.kofax.kmc.ken.engines.ImageProcessor.addImageOutEventListener ( ImageOutListener  listener)
inline

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

void com.kofax.kmc.ken.engines.ImageProcessor.addProcessProgressEventListener ( ProcessProgressListener  listener)
inline

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

void com.kofax.kmc.ken.engines.ImageProcessor.cancel ( )
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.doCleanup ( )
inline

Log app stats dismissal time and 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 com.kofax.kmc.ken.engines.ImageProcessor.doQuickAnalysis ( Image  image,
boolean  returnPreviewImage 
) throws KmcException
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.doQuickAnalysis ( Image  image,
boolean  returnPreviewImage,
QuickAnalysisSettings  settings 
) throws KmcException
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.getBasicSettingsProfile ( )
inline

Get the BasicSettingsProfile (basic image processing settings).

Returns
the BasicSettingsProfile
ImagePerfectionProfile com.kofax.kmc.ken.engines.ImageProcessor.getImagePerfectionProfile ( )
inline

Get the ImagePerfectionProfile (advanced image processing settings).

Returns
the ImagePerfectionProfile
ListenerCallbackThreadType com.kofax.kmc.ken.engines.ImageProcessor.getListenerCallbackThreadType ( )
inline

Get the ListenerCallbackThreadType.

Returns
the thread type for asynchronous callbacks
String com.kofax.kmc.ken.engines.ImageProcessor.getProcessedImageFilePath ( )
inline

Get the output image file path.

Returns
the output image file path
int com.kofax.kmc.ken.engines.ImageProcessor.getProcessedImageJpegQuality ( )
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.getProcessedImageMimeType ( )
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.getProcessedImageRepresentation ( )
inline

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

Returns
the ProcessedImageRepresentation
void com.kofax.kmc.ken.engines.ImageProcessor.processImage ( Image  image) throws KmcException
inline

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).
void com.kofax.kmc.ken.engines.ImageProcessor.removeAnalysisCompleteEventListener ( AnalysisCompleteListener  listener)
inline

Removes the specified AnalysisCompleteListener from the ImageProcessor.

void com.kofax.kmc.ken.engines.ImageProcessor.removeAnalysisProgressEventListener ( AnalysisProgressListener  listener)
inline

Removes the specified AnalysisProgressListener from the ImageProcessor.

void com.kofax.kmc.ken.engines.ImageProcessor.removeImageOutEventListener ( ImageOutListener  listener)
inline

Removes the specified ImageOutListener from the ImageProcessor.

void com.kofax.kmc.ken.engines.ImageProcessor.removeProcessProgressEventListener ( ProcessProgressListener  listener)
inline

Removes the specified ProcessProgressListener from the ImageProcessor.

void com.kofax.kmc.ken.engines.ImageProcessor.setBasicSettingsProfile ( BasicSettingsProfile  basicSettingsProfile)
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.setImagePerfectionProfile ( ImagePerfectionProfile  imagePerfectionProfile)
inline

Set the ImagePerfectionProfile (advanced image processing settings).

Set the advanced image processing settings.

void com.kofax.kmc.ken.engines.ImageProcessor.setListenerCallbackThreadType ( ListenerCallbackThreadType  listenerCallbackThreadType)
inline

Set the thread type for asynchronous callbacks.

Defaults to ListenerCallbackThreadType#UI_THREAD.

Parameters
listenerCallbackThreadTypethe thread type for asynchronous callbacks
void com.kofax.kmc.ken.engines.ImageProcessor.setProcessedImageFilePath ( String  processedImageFilePath)
inline

Set the output image file path.

void com.kofax.kmc.ken.engines.ImageProcessor.setProcessedImageJpegQuality ( int  processedImageJpegQuality)
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.setProcessedImageMimeType ( ImageMimeType  processedImageMimeType)
inline

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 com.kofax.kmc.ken.engines.ImageProcessor.setProcessedImageRepresentation ( ImageRep  processedImageRepresentation)
inline

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 © 2016 Atalasoft, Inc., 116 Pleasant St, Suite 321, Easthampton, MA 01027, U.S.A. All rights reserved. Use is subject to license terms.