You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
308 B
JavaScript
16 lines
308 B
JavaScript
7 years ago
|
'use strict';
|
||
|
|
||
|
module.exports = function scanRow(imageData, offset, length) {
|
||
|
let highestValue = 0;
|
||
|
|
||
|
for (let column = 0; column < length; column += 1) {
|
||
|
let pixelValue = imageData[offset + (column * 4)];
|
||
|
|
||
|
if (pixelValue > highestValue) {
|
||
|
highestValue = pixelValue;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return highestValue;
|
||
|
};
|