plugins/restiming.js
/**
	 * Counts the number of pixels that are set in the given 2D array representing the screen
	 * @param {number[][]} pixels A 2D boolean array representing the screen with painted pixels set to true
	 * @param {number} [rangeMin] If included, will only count pixels >= this value
	 * @param {number} [rangeMax] If included, will only count pixels <= this value
	 * @return {number} The number of pixels set in the passed in array
	 */
Counts the number of pixels that are set in the given 2D array representing the screen
@param {number[][]} pixels A 2D boolean array representing the screen with painted pixels set to true
@param {number} [rangeMin] If included, will only count pixels >= this value
@param {number} [rangeMax] If included, will only count pixels <= this value
@return {number} The number of pixels set in the passed in array
Counts the number of pixels that are set in the given 2D array representing the screen @param { number [] [] } pixels A 2D boolean array representing the screen with painted pixels set to true @param { number } [ rangeMin ] If included will only count pixels > = this value @param { number } [ rangeMax ] If included will only count pixels < = this value @return { number } The number of pixels set in the passed in array
function countPixels(pixels, rangeMin, rangeMax) {
		rangeMin = rangeMin || 0;
		rangeMax = rangeMax || Infinity;
		return pixels
			.reduce(function(acc, val) {
				return acc +
					val.filter(function(v) {
						return rangeMin <= v && v <= rangeMax;
					}).length;
			},
			0
		);
	}
function countPixels ( pixels , rangeMin , rangeMax ) { rangeMin = rangeMin || 0 ; rangeMax = rangeMax || Infinity ; return pixels . reduce ( function ( acc , val ) { return acc + val . filter ( function ( v ) { return rangeMin <= v && v <= rangeMax ; } ) . length ; } , 0 ) ; }
Counts the number of pixels that are set in the given 2D array representing the screen
 @param {number[][]} pixels A 2D boolean array representing the screen with painted pixels set to true
 @param {number} [rangeMin] If included, will only count pixels >= this value
 @param {number} [rangeMax] If included, will only count pixels <= this value
 @return {number} The number of pixels set in the passed in array
Counts the number of pixels that are set in the given 2D array representing the screen @param { number [] [] } pixels A 2D boolean array representing the screen with painted pixels set to true @param { number } [ rangeMin ] If included will only count pixels > = this value @param { number } [ rangeMax ] If included will only count pixels < = this value @return { number } The number of pixels set in the passed in array