Skip to content

Commit

Permalink
doc: add a note about calling getImageData() and setting the `willR…
Browse files Browse the repository at this point in the history
…eadFrequently` attribute
  • Loading branch information
obiot committed Dec 28, 2022
1 parent 5300602 commit 2bd4c54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/texture/canvas_texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class CanvasTexture {
}

/**
* Returns an ImageData object representing the underlying pixel data for a specified portion of this canvas texture
* Returns an ImageData object representing the underlying pixel data for a specified portion of this canvas texture.
* (Note: when using getImageData(), it is highly recommended to use the `willReadFrequently` attribute when creatimg the corresponding canvas texture)
* @param {number} x - The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted
* @param {number} y - The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted
* @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left
Expand Down

0 comments on commit 2bd4c54

Please sign in to comment.