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