UNPKG

pixel-utils

Version:
12 lines (11 loc) 428 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = convert_double_all_string; // convert a 2-band pixel // if any no data is found, set all RGB to no data function convert_double_all_string(old_no_data_value, noDataPixel, scalefn1, scalefn2, pixel) { if (pixel.includes(old_no_data_value)) return noDataPixel; return `rgba(${scalefn1(pixel[0])},${scalefn2(pixel[1])},0,255)`; }