pixel-utils
Version:
Utility Functions for Pixels
16 lines (15 loc) • 334 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = select_rcb;
// like ImageData.data
function select_rcb(data, depth, width, r, c) {
const pixel = [];
let i = (r * width + c) * depth;
const imax = i + depth;
for (; i < imax; i++) {
pixel.push(data[i]);
}
return pixel;
}