pixel-utils
Version:
Utility Functions for Pixels
11 lines (10 loc) • 343 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = convert_raw_one_band_pixel_to_rgb;
function convert_raw_one_band_pixel_to_rgb(noDataValue, noDataPixel, scale, pixel) {
if (pixel.includes(noDataValue)) return noDataPixel;
const scaled = scale(pixel[0]);
return [scaled, scaled, scaled];
}