Class: Matrix

Matrix

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
pixels array The pixels in a linear [r,g,b,a,...] array to loop through.
width number The image width.
height number The image height.
fn function The callback function for each pixel.
opt_jump number Optional jump for the iteration, by default it is 1, hence loops all the pixels of the array.
Source: