UNPKG

pixel-utils

Version:
12 lines (11 loc) 325 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = convert_one; function convert_one(old_no_data_value, noDataPixel, scalefn, pixel) { const n = pixel[0]; if (n === old_no_data_value) return noDataPixel; const scaled = scalefn(n); return [scaled, scaled, scaled, 255]; }