fr:code:core:image
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| fr:code:core:image [2012/03/21 10:23] – [applyFilter] wismerheal | fr:code:core:image [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Image ====== | ====== Image ====== | ||
| Cet objet représente une image. | Cet objet représente une image. | ||
| + | |||
| + | **Attention, | ||
| ===== Fonctions ===== | ===== Fonctions ===== | ||
| Ligne 36: | Ligne 38: | ||
| ==== takeScreenshot ==== | ==== takeScreenshot ==== | ||
| - | Prend un screenshot | + | Prend une capture d' |
| Ligne 48: | Ligne 50: | ||
| === Arguments === | === Arguments === | ||
| - | - fenêtre - ([[en: | + | - fenêtre - ([[en: |
| === Exceptions === | === Exceptions === | ||
| * (InvalidWindowError) fenêtre invalide | * (InvalidWindowError) fenêtre invalide | ||
| + | [TODO: | ||
| + | |||
| + | ==== takeScreenshotUsingScreenIndex ==== | ||
| + | Take a screenshot of one screen and store the result in a new Image. [//Added in Actionaz 3.7.0.//] | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | var myObject = Image.takeScreenshotUsingScreenIndex(0); | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - screenIndex - (integer) the index of the screen to screenshot | ||
| + | |||
| + | === Exceptions === | ||
| + | * (InvalidScreenIndexError) invalid screen index | ||
| + | | ||
| + | | ||
| ===== Méthodes ===== | ===== Méthodes ===== | ||
| Ligne 72: | Ligne 91: | ||
| ==== equals ==== | ==== equals ==== | ||
| - | Retourne | + | Renvoie |
| === Syntaxe === | === Syntaxe === | ||
| Ligne 198: | Ligne 217: | ||
| - filtre - ([[# | - filtre - ([[# | ||
| - options - (objet) option de filtre | - options - (objet) option de filtre | ||
| - | * filterChannels - (chaîne) la couleur | + | * filterChannels - (chaîne) la couleur sur laquelle sera appliquée le filtre. |
| - | * filterBorderPolicy - (chaîne) utilisé avec le filtre de convolution. Les valeurs sont "miroir", "étendre" ou "envelopper" | + | * filterBorderPolicy - (string) utilisé avec le filtre de convolution. Les valeurs sont "mirror", "extend" ou "wrap" |
| - | * convolutionDivisor - (entier) le diviseur de convolution | + | * convolutionDivisor - (integer) le diviseur de convolution |
| - | * convolutionBias - (entier) le biais de convolution | + | * convolutionBias - (integer) le biais de convolution |
| - | * radius - (nombre) le radius | + | * radius - (number) le radius |
| - | * force - (nombre) la force (Utilise la, Luc!) | + | * force - (number) la force (Utilise la, Luc!) |
| - | * center - (objet) le centre | + | * center - (object) le centre |
| - | * x - (entier) la coordonnée x | + | * x - (integer) la coordonnée x |
| - | * y - (entier) la coordonnée y | + | * y - (integer) la coordonnée y |
| === Renvoie === | === Renvoie === | ||
| Ligne 214: | Ligne 233: | ||
| * (ApplyFilterError) incapable d' | * (ApplyFilterError) incapable d' | ||
| + | | ||
| + | ==== pixel ==== | ||
| + | Returns a pixel from this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.pixel(x, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - x - (integer) x coordinate of the pixel to return | ||
| + | - y - (integer) y coordinate of the pixel to return | ||
| + | |||
| + | === Returns === | ||
| + | * ([[en: | ||
| + | |||
| + | ==== setPixel ==== | ||
| + | Sets a pixel from this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.pixel(x, | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.pixel(x, | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.pixel(x, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - x - (integer) x coordinate of the pixel to set | ||
| + | - y - (integer) y coordinate of the pixel to set | ||
| + | - color - ([[en: | ||
| + | - red - (integer) red value of the color to set | ||
| + | - green - (integer) green value of the color to set | ||
| + | - blue - (integer) blue value of the color to set | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) this Image | ||
| + | |||
| + | ==== mirror ==== | ||
| + | Mirror this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.mirror(mirrorOrientation); | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - mirrorOrientation - ([[# | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) this Image | ||
| + | |||
| + | ==== setSize ==== | ||
| + | Resizes this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.setSize(size); | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.setSize(width, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - size - ([[en: | ||
| + | - width - (integer) the new width of this Image | ||
| + | - height - (integer) the new height of this Image | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) this Image | ||
| + | |||
| + | ==== size ==== | ||
| + | Returns the size of this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.size(); | ||
| + | </ | ||
| + | |||
| + | === Returns === | ||
| + | * ([[en: | ||
| + | |||
| + | ==== width ==== | ||
| + | Returns the width of this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.width(); | ||
| + | </ | ||
| + | |||
| + | === Returns === | ||
| + | * (integer) the width of this Image | ||
| + | |||
| + | ==== height ==== | ||
| + | Returns the height of this Image. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.height(); | ||
| + | </ | ||
| + | |||
| + | === Returns === | ||
| + | * (integer) the height of this Image | ||
| + | |||
| + | ==== copy ==== | ||
| + | Returns a copy of this Image or only a part of it. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.copy(); | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.copy(rect); | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - rect - ([[en: | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) a new copy of this Image | ||
| + | |||
| + | ==== findSubImage ==== | ||
| + | Searches for another image contained in this one. | ||
| + | |||
| + | //Added in Actionaz 3.0.1.// | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.findSubImage(otherImage); | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.findSubImage(otherImage, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - otherImage - (Image) the Image to find | ||
| + | - options - (object) search options | ||
| + | * confidenceMinimum - (integer) the minimum confidence percentage, 100 means perfect match (default: 70) | ||
| + | * downPyramidCount - (integer) the number of pyramids to use. A pyramid is a subdivision of the image used to accelerate the search. Choose 1 here if the searched image is not very different from this image. (default: 2) | ||
| + | * method - ([[# | ||
| + | |||
| + | === Returns === | ||
| + | * (object) the matching point, or null if no matching point can be found | ||
| + | * position - ([[en: | ||
| + | * confidence - (integer) the confidence percentage | ||
| + | |||
| + | === Exceptions === | ||
| + | * (FindSubImageError) an error occured while searching for a sub-image | ||
| + | * (ParameterTypeError) incorrect parameter type | ||
| + | |||
| + | === Example === | ||
| + | <code javascript> | ||
| + | //Searches for an object on the screen | ||
| + | var screenShot = Image.takeScreenshot(); | ||
| + | var imageToFind = new Image(" | ||
| + | |||
| + | var searchResult = screenShot.findSubImage(imageToFind); | ||
| + | if(searchResult) | ||
| + | Console.print(" | ||
| + | else | ||
| + | Console.print(" | ||
| + | </ | ||
| + | |||
| + | ==== findSubImages ==== | ||
| + | Searches for images contained in this one. | ||
| + | |||
| + | //Added in Actionaz 3.0.1.// | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.findSubImages(otherImage); | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.findSubImages(otherImage, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - otherImage - (Image) the Image to find | ||
| + | - options - (object) search options | ||
| + | * confidenceMinimum - (integer) the minimum confidence percentage, 100 means perfect match (default: 70) | ||
| + | * downPyramidCount - (integer) the number of pyramids to use. A pyramid is a subdivision of the image used to accelerate the search. Choose 1 here if the searched image is not very different from this image. (default: 2) | ||
| + | * searchExpansion - (integer) the number of pixels to shift when searching for another matching image (default: 15) | ||
| + | * maximumMatches - (integer) the maximal number of matches (default: 10) | ||
| + | * method - ([[# | ||
| + | |||
| + | === Returns === | ||
| + | * (array of objects) the matching points, or null if no matching point can be found | ||
| + | * position - ([[en: | ||
| + | * confidence - (integer) the confidence percentage | ||
| + | |||
| + | === Exceptions === | ||
| + | * (FindSubImageError) an error occured while searching for a sub-image | ||
| + | * (ParameterTypeError) incorrect parameter type | ||
| + | |||
| + | === Example === | ||
| + | <code javascript> | ||
| + | //Searches for objects on the screen | ||
| + | var screenShot = Image.takeScreenshot(); | ||
| + | var imageToFind = new Image(" | ||
| + | |||
| + | var searchResult = screenShot.findSubImages(imageToFind); | ||
| + | if(searchResult) | ||
| + | { | ||
| + | Console.print(" | ||
| + | | ||
| + | for(var i = 0; i < searchResult.length; | ||
| + | { | ||
| + | Console.print(" | ||
| + | } | ||
| + | } | ||
| + | else | ||
| + | Console.print(" | ||
| + | </ | ||
| + | ==== findSubImageAsync ==== | ||
| + | Searches for another image contained in this one in asynchronous mode. | ||
| + | |||
| + | //Added in Actionaz 3.0.1.// | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.findSubImageAsync(otherImage, | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.findSubImageAsync(otherImage, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - otherImage - (Image) the Image to find | ||
| + | - callback(object) - (function) the function that will be called when the search ends | ||
| + | * position - ([[en: | ||
| + | * confidence - (integer) the confidence percentage | ||
| + | - options - (object) search options | ||
| + | * confidenceMinimum - (integer) the minimum confidence percentage, 100 means perfect match (default: 70) | ||
| + | * downPyramidCount - (integer) the number of pyramids to use. A pyramid is a subdivision of the image used to accelerate the search. Choose 1 here if the searched image is not very different from this image. (default: 2) | ||
| + | * searchExpansion - (integer) the number of pixels to shift when searching for another matching image (default: 15) | ||
| + | * method - ([[# | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) this Image | ||
| + | |||
| + | === Exceptions === | ||
| + | * (FindSubImageError) an error occured while searching for a sub-image | ||
| + | * (ParameterTypeError) incorrect parameter type | ||
| + | |||
| + | === Example === | ||
| + | <code javascript> | ||
| + | //Searches for an object on the screen | ||
| + | var screenShot = Image.takeScreenshot(); | ||
| + | var imageToFind = new Image(" | ||
| + | |||
| + | screenShot.findSubImageAsync(imageToFind, | ||
| + | { | ||
| + | if(searchResult) | ||
| + | Console.print(" | ||
| + | else | ||
| + | Console.print(" | ||
| + | }); | ||
| + | </ | ||
| + | ==== findSubImagesAsync ==== | ||
| + | Searches for images contained in this one in asynchronous mode. | ||
| + | |||
| + | //Added in Actionaz 3.0.1.// | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.findSubImagesAsync(otherImage, | ||
| + | </ | ||
| + | <code javascript> | ||
| + | myObject.findSubImagesAsync(otherImage, | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - otherImage - (Image) the Image to find | ||
| + | - callback(object) - (function) the function that will be called when the search ends | ||
| + | * position - ([[en: | ||
| + | * confidence - (integer) the confidence percentage | ||
| + | - options - (object) search options | ||
| + | * confidenceMinimum - (integer) the minimum confidence percentage, 100 means perfect match (default: 70) | ||
| + | * downPyramidCount - (integer) the number of pyramids to use. A pyramid is a subdivision of the image used to accelerate the search. Choose 1 here if the searched image is not very different from this image. (default: 2) | ||
| + | * searchExpansion - (integer) the number of pixels to shift when searching for another matching image (default: 15) | ||
| + | * maximumMatches - (integer) the maximal number of matches (default: 10) | ||
| + | * method - ([[# | ||
| + | |||
| + | === Returns === | ||
| + | * (Image) this Image | ||
| + | |||
| + | === Exceptions === | ||
| + | * (FindSubImageError) an error occured while searching for a sub-image | ||
| + | * (ParameterTypeError) incorrect parameter type | ||
| + | |||
| + | === Example === | ||
| + | <code javascript> | ||
| + | //Searches for objects on the screen | ||
| + | var screenShot = Image.takeScreenshot(); | ||
| + | var imageToFind = new Image(" | ||
| + | |||
| + | screenShot.findSubImagesAsync(imageToFind, | ||
| + | { | ||
| + | if(searchResult) | ||
| + | { | ||
| + | Console.print(" | ||
| + | | ||
| + | for(var i = 0; i < searchResult.length; | ||
| + | { | ||
| + | Console.print(" | ||
| + | } | ||
| + | } | ||
| + | else | ||
| + | Console.print(" | ||
| + | }); | ||
| + | </ | ||
| + | ===== Enumerations ===== | ||
| + | |||
| + | ==== Filter ==== | ||
| + | Image filters. | ||
| + | |||
| + | === Values === | ||
| + | - ConvolutionFilter: | ||
| + | - GaussianBlur: | ||
| + | - Defocus: blurs the image | ||
| + | - Highlight: highlight the image | ||
| + | - Sharpen: sharpens the image | ||
| + | - SharpenMore: | ||
| + | - SharpenEvenMore: | ||
| + | - EdgeDetect: edge detection filter | ||
| + | - BigEdge: edge detection filter (thicker edges) | ||
| + | - Emboss: embosses the image (no color preservation) | ||
| + | - EmbossColor: | ||
| + | - Negative: negates a color channel | ||
| + | - RemoveChannel: | ||
| + | - Punch: distorts the image | ||
| + | |||
| + | ==== MirrorOrientation ==== | ||
| + | Mirror orientation. | ||
| + | |||
| + | === Values === | ||
| + | - Vertical: a vertical mirror | ||
| + | - Horizontal: an horizontal mirror | ||
| + | |||
| + | ==== Method ==== | ||
| + | Search method. [//Added in Actionaz 3.7.0.//] | ||
| + | |||
| + | === Values === | ||
| + | - CorrelationCoefficient: | ||
| + | - CrossCorrelation: | ||
| + | - SquaredDifference: | ||
fr/code/core/image.1332325400.txt.gz · Dernière modification : (modification externe)
