Class: GlareRemover

GlareRemover()

new GlareRemover()

This GlareRemover class is responsible for handling the corresponding plugin js to interact with the native Glare Remover class. To set and get the properties, and to access the instance methods, corresponding JS methods are written under this class which are used by the end user in application script. Use the Glare Remover object for removing the glare from images.

Methods

getGlareFraction(successCallback, errorCallback, imageID:)

User calls this method to get the amount of glare on an image.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
imageID: Array image ID that should be passed to get the glare fraction.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - The library returns glare fraction. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var glareRemover = kfxCordova.kfxEngine.createGlareRemover();
glareRemover.getGlareFraction(successCallback,errorCallback,"ImageID");

removeGlare(successCallback, errorCallback, imageIDs:)

User calls this method to remove glare using the passed in images.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
imageIDs: Array A List of image IDs you would like to remove the glare. Should pass in two of these objects captured at different angles so that glare would be distributed at different places. Of these, the reference image that user wants to perform glare removal should be passed as the first object of the array.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - The library returns glare free image. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var glareRemover = kfxCordova.kfxEngine.createGlareRemover();
glareRemover.removeGlare(successCallback,errorCallback,["ImageID1","ImageID2"]);