new Matrix()
Matrix utility.
- Source:
Methods
-
<static> forEach(pixels, width, height, fn, opt_jump)
-
Loops the array organized as major-row order and executes `fn` callback for each iteration. The `fn` callback receives the following parameters: `(r,g,b,a,index,i,j)`, where `r,g,b,a` represents the pixel color with alpha channel, `index` represents the position in the major-row order array and `i,j` the respective indexes positions in two dimentions.
Parameters:
Name Type Description pixelsarray The pixels in a linear [r,g,b,a,...] array to loop through. widthnumber The image width. heightnumber The image height. fnfunction The callback function for each pixel. opt_jumpnumber Optional jump for the iteration, by default it is 1, hence loops all the pixels of the array. - Source: