Outils pour utilisateurs

Outils du site


fr:code:core:image

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
fr:code:core:image [2011/09/22 03:31] fredy123fr: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, cette page n'est pas complètement traduite. Voir la version originale : [[en:code:core:image]]**
  
 ===== Fonctions ===== ===== Fonctions =====
Ligne 26: Ligne 28:
  
 === Exemple === === Exemple ===
-Create a empty Image.+Créer une nouvelle image vide.
 <code javascript> <code javascript>
 var monObjet = new Image(); var monObjet = new Image();
 </code> </code>
-Créez une Image représentant une copie de ** autreImage **. +Créer une Image représentant une copie de ** autreImage **. 
 <code javascript> <code javascript>
 var monObjet = new Image(autreImage); var monObjet = new Image(autreImage);
Ligne 36: Ligne 38:
  
 ==== takeScreenshot ==== ==== takeScreenshot ====
-Prend un screenshot de l'écran entier ou seulement de la ** fenêtre ** et conserve le résultat dans une nouvelle Image. +Prend une capture d'écran de l'écran entier ou seulement de la ** fenêtre ** et conserve le résultat dans une nouvelle Image. 
  
  
Ligne 48: Ligne 50:
  
 === Arguments === === Arguments ===
-  - fenêtre - ([[en:code:core:window|Window]]) la fenêtre à screenshot +  - fenêtre - ([[en:code:core:window|Window]]) la fenêtre dont vous voulez capturer une image 
  
 === Exceptions === === Exceptions ===
   * (InvalidWindowError) fenêtre invalide   * (InvalidWindowError) fenêtre invalide
  
 +  [TODO:Translate]
 +
 +==== 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);
 +</code>
 +
 +=== 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 vrai si cette Image et un autre se réfèrent à la même image. +Renvoie vrai si cette Image et un autre se réfèrent à la même image. 
  
 === Syntaxe === === Syntaxe ===
Ligne 198: Ligne 217:
   - filtre - ([[#filter|Filtre]]) le filtre à utiliser   - filtre - ([[#filter|Filtre]]) le filtre à utiliser
   - options - (objet) option de filtre   - options - (objet) option de filtre
-    * filterChannels - (chaîne) the color channel(s) to perform the filtering onA string consisting of zero or one entity of each of the characters r,g,b,a +    * filterChannels - (chaîne) la couleur sur laquelle sera appliquée le filtreUne chaîne de caractères constituée de zéro ou une occurence des caractères r,g,b,a 
-    * 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 (use itLuke!) +    * force - (number) la force (Utilise laLuc!) 
-    * 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'appliquer le filtre    * (ApplyFilterError) incapable d'appliquer le filtre 
  
 + [TODO:Translate] 
 +==== pixel ====
 +Returns a pixel from this Image.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.pixel(x, y);
 +</code>
 +
 +=== Arguments ===
 +  - x - (integer) x coordinate of the pixel to return
 +  - y - (integer) y coordinate of the pixel to return
 +
 +=== Returns ===
 +  * ([[en:code:core:color|Color]]) the pixel
 +
 +==== setPixel ====
 +Sets a pixel from this Image.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.pixel(x, y, color);
 +</code>
 +<code javascript>
 +myObject.pixel(x, y, colorString);
 +</code>
 +<code javascript>
 +myObject.pixel(x, y, red, green, blue);
 +</code>
 +
 +=== Arguments ===
 +  - x - (integer) x coordinate of the pixel to set
 +  - y - (integer) y coordinate of the pixel to set
 +  - color - ([[en:code:core:color|Color]]) color of the pixel to set
 +  - 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);
 +</code>
 +
 +=== Arguments ===
 +  - mirrorOrientation - ([[#mirrororientation|MirrorOrientation]]) mirror orientation
 +
 +=== Returns ===
 +  * (Image) this Image
 +
 +==== setSize ====
 +Resizes this Image.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.setSize(size);
 +</code>
 +<code javascript>
 +myObject.setSize(width, height);
 +</code>
 +
 +=== Arguments ===
 +  - size - ([[en:code:core:size|Size]]) the new Image size
 +  - 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();
 +</code>
 +
 +=== Returns ===
 +  * ([[en:code:core:size|Size]]) the size of this Image
 +
 +==== width ====
 +Returns the width of this Image.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.width();
 +</code>
 +
 +=== Returns ===
 +  * (integer) the width of this Image
 +
 +==== height ====
 +Returns the height of this Image.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.height();
 +</code>
 +
 +=== 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>
 +<code javascript>
 +myObject.copy(rect);
 +</code>
 +
 +=== Arguments ===
 +  - rect - ([[en:code:core:rect|Rect]]) the section of this Image to copy
 +
 +=== 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>
 +<code javascript>
 +myObject.findSubImage(otherImage, options);
 +</code>
 +
 +=== 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 - ([[#method|Method]]) the search method to use (default: CorrelationCoefficient) [//Added in Actionaz 3.7.0.//]
 +
 +=== Returns ===
 +  * (object) the matching point, or null if no matching point can be found
 +    * position - ([[en:code:core:point|Point]]) the matching image center
 +    * 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("object.png");
 +
 +var searchResult = screenShot.findSubImage(imageToFind);
 +if(searchResult)
 +    Console.print("Matching image found, position: " + searchResult.position + ", confidence: " + searchResult.confidence);
 +else
 +    Console.print("No matching image found.");
 +</code>
 +
 +==== findSubImages ====
 +Searches for images contained in this one.
 +
 +//Added in Actionaz 3.0.1.//
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.findSubImages(otherImage);
 +</code>
 +<code javascript>
 +myObject.findSubImages(otherImage, options);
 +</code>
 +
 +=== 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 - ([[#method|Method]]) the search method to use (default: CorrelationCoefficient) [//Added in Actionaz 3.7.0.//]
 +
 +=== Returns ===
 +  * (array of objects) the matching points, or null if no matching point can be found
 +    * position - ([[en:code:core:point|Point]]) the matching image center
 +    * 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("object.png");
 +
 +var searchResult = screenShot.findSubImages(imageToFind);
 +if(searchResult)
 +{
 +    Console.print("Matching images found\n");
 +    
 +    for(var i = 0; i < searchResult.length; ++i)
 +    {
 +        Console.print("position: " + searchResult[i].position + ", confidence: " + searchResult[i].confidence + "\n");
 +    }
 +}
 +else
 +    Console.print("No matching images found.");
 +</code>
 +==== findSubImageAsync ====
 +Searches for another image contained in this one in asynchronous mode.
 +
 +//Added in Actionaz 3.0.1.//
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.findSubImageAsync(otherImage, callback);
 +</code>
 +<code javascript>
 +myObject.findSubImageAsync(otherImage, callback, options);
 +</code>
 +
 +=== Arguments ===
 +  - otherImage - (Image) the Image to find
 +  - callback(object) - (function) the function that will be called when the search ends
 +    * position - ([[en:code:core:point|Point]]) the matching image center
 +    * 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 - ([[#method|Method]]) the search method to use (default: CorrelationCoefficient) [//Added in Actionaz 3.7.0.//]
 +
 +=== 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("object.png");
 +
 +screenShot.findSubImageAsync(imageToFind, function(searchResult)
 +{
 +    if(searchResult)
 +        Console.print("Matching image found, position: " + searchResult.position + ", confidence: " + searchResult.confidence);
 +    else
 +        Console.print("No matching image found.");
 +});
 +</code>
 +==== findSubImagesAsync ====
 +Searches for images contained in this one in asynchronous mode.
 +
 +//Added in Actionaz 3.0.1.//
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.findSubImagesAsync(otherImage, callback);
 +</code>
 +<code javascript>
 +myObject.findSubImagesAsync(otherImage, callback, options);
 +</code>
 +
 +=== Arguments ===
 +  - otherImage - (Image) the Image to find
 +  - callback(object) - (function) the function that will be called when the search ends
 +    * position - ([[en:code:core:point|Point]]) the matching image center
 +    * 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 - ([[#method|Method]]) the search method to use (default: CorrelationCoefficient) [//Added in Actionaz 3.7.0.//]
 +
 +=== 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("object.png");
 +
 +screenShot.findSubImagesAsync(imageToFind, function(searchResult)
 +{
 +    if(searchResult)
 +    {
 +        Console.print("Matching images found\n");
 +    
 +        for(var i = 0; i < searchResult.length; ++i)
 +        {
 +            Console.print("position: " + searchResult[i].position + ", confidence: " + searchResult[i].confidence + "\n");
 +        }
 +    }
 +    else
 +        Console.print("No matching images found.");
 +});
 +</code>
 +===== Enumerations =====
 +
 +==== Filter ====
 +Image filters.
 +
 +=== Values ===
 +  - ConvolutionFilter: the convolution filter
 +  - GaussianBlur: a gaussian blur
 +  - Defocus: blurs the image
 +  - Highlight: highlight the image
 +  - Sharpen: sharpens the image
 +  - SharpenMore: sharpens the image
 +  - SharpenEvenMore: sharpens the image
 +  - EdgeDetect: edge detection filter
 +  - BigEdge: edge detection filter (thicker edges)
 +  - Emboss: embosses the image (no color preservation)
 +  - EmbossColor: embosses the image (color preservation)
 +  - Negative: negates a color channel
 +  - RemoveChannel: remove a color channel
 +  - 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: correlation coefficient, best for most use cases
 +  - CrossCorrelation: cross correlation
 +  - SquaredDifference: squared difference 
fr/code/core/image.1316662318.txt.gz · Dernière modification : 2021/02/13 11:23 (modification externe)