pixel-utils
Version:
Utility Functions for Pixels
12 lines (11 loc) • 405 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = convert_double_all;
// convert a 2-band pixel
// if any no data is found, set all RGB to no data
function convert_double_all(old_no_data_value, noDataPixel, scalefn1, scalefn2, pixel) {
if (pixel.includes(old_no_data_value)) return noDataPixel;
return [scalefn1(pixel[0]), scalefn2(pixel[1]), 0, 255];
}