UNPKG

pixel-utils

Version:
15 lines (14 loc) 422 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isNoData; /** * @description check if an RGB pixel is a no data pixel * @param {number} no_data_value * @param {number[]} pixel - an array of 4 numbers representing [R, G, B, A] * @returns {boolean} whether the pixel is a no data pixel */ function isNoData(no_data_value, pixel) { return pixel[0] === no_data_value; }