Class IM
Version
1.0.
Represents an Image Match
Defined in: IM.js.
Constructor Attributes | Constructor Name and Description |
---|---|
IM()
IM (Image Match) is a class to compare images using canvas at pixel level
|
Field Attributes | Field Name and Description |
---|---|
Image is a reference to ImageToCompare.
|
Method Attributes | Method Name and Description |
---|---|
compare(oContainer/aCanvas, aElements/fpSuccess, fpSuccess/fpFail, fpFail)
Compare is the method that change the behaviour if it's needed to create canvas or not.
|
|
setAsynchronous(bLocalAsynchronous)
Change the loop type to and from asynchronous.
|
|
setDebug(bLocalDebug)
setDebug is the method to set the debug to allow check the incorrect canvas and log how many time it tooks.
|
|
setTolerance(nMinPercentage)
setTolerance must be used if you want to check if the match you want is correct.
|
|
showDiffInCanvas(oLocalContainerDiff)
showDiffInCanvas is the method that sets the diff mode to create a canvas with the difference
|
Class Detail
IM()
IM (Image Match) is a class to compare images using canvas at pixel level
Author: Tomas Corral Casas.
Author: Tomas Corral Casas.
Field Detail
image
Image is a reference to ImageToCompare.
Method Detail
compare(oContainer/aCanvas, aElements/fpSuccess, fpSuccess/fpFail, fpFail)
Compare is the method that change the behaviour if it's needed to create canvas or not.
- Parameters:
- oContainer/aCanvas
- aElements/fpSuccess
- fpSuccess/fpFail
- fpFail
{Boolean}
setAsynchronous(bLocalAsynchronous)
Change the loop type to and from asynchronous.
- Parameters:
- bLocalAsynchronous
- Returns:
- {Boolean} bLocalAsynchronous
{Boolean}
setDebug(bLocalDebug)
setDebug is the method to set the debug to allow check the incorrect canvas and log how many time it tooks.
- Parameters:
- bLocalDebug
- Returns:
- {Boolean} bDebug
setTolerance(nMinPercentage)
setTolerance must be used if you want to check if the match you want is correct.
It is important to assign a tolerance of difference between images.
If the image has a difference lower than nMinPercentage the image will be treated as ok.
- Parameters:
- {Number} nMinPercentage
{Object}
showDiffInCanvas(oLocalContainerDiff)
showDiffInCanvas is the method that sets the diff mode to create a canvas with the difference
- Parameters:
- {Object} oLocalContainerDiff
- Returns:
- {Object} Element where put the result canvas