node-libpng
Version:
Unofficial bindings for node to libpng.
59 lines • 2.49 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultBackgroundColor = exports.colorTypeToColorChecker = void 0;
const color_type_1 = require("../color-type");
const gray_scale_alpha_1 = require("./gray-scale-alpha");
const gray_scale_1 = require("./gray-scale");
const palette_1 = require("./palette");
const rgb_1 = require("./rgb");
const rgba_1 = require("./rgba");
__exportStar(require("./gray-scale-alpha"), exports);
__exportStar(require("./gray-scale"), exports);
__exportStar(require("./palette"), exports);
__exportStar(require("./rgb"), exports);
__exportStar(require("./rgba"), exports);
function colorTypeToColorChecker(colorType) {
switch (colorType) {
case color_type_1.ColorType.GRAY_SCALE:
return gray_scale_1.isColorGrayScale;
case color_type_1.ColorType.GRAY_SCALE_ALPHA:
return gray_scale_alpha_1.isColorGrayScaleAlpha;
case color_type_1.ColorType.PALETTE:
return palette_1.isColorPalette;
case color_type_1.ColorType.RGB:
return rgb_1.isColorRGB;
case color_type_1.ColorType.RGBA:
return rgba_1.isColorRGBA;
default:
return;
}
}
exports.colorTypeToColorChecker = colorTypeToColorChecker;
function defaultBackgroundColor(colorType) {
switch (colorType) {
case color_type_1.ColorType.GRAY_SCALE:
return gray_scale_1.colorGrayScale(255);
case color_type_1.ColorType.GRAY_SCALE_ALPHA:
return gray_scale_alpha_1.colorGrayScaleAlpha(0, 0);
case color_type_1.ColorType.PALETTE:
return palette_1.colorPalette(0);
case color_type_1.ColorType.RGB:
return rgb_1.colorRGB(255, 255, 255);
case color_type_1.ColorType.RGBA:
return rgba_1.colorRGBA(0, 0, 0, 0);
default:
return;
}
}
exports.defaultBackgroundColor = defaultBackgroundColor;
//# sourceMappingURL=index.js.map