UNPKG

image-js

Version:

Image processing and manipulation in JavaScript

19 lines 762 B
import { match } from 'ts-pattern'; import { getBinaryMap } from './colorMaps/getBinaryMap.js'; import { getRainbowMap } from './colorMaps/getRainbowMap.js'; import { getSaturationMap } from './colorMaps/getSaturationMap.js'; /** * Return a map of 32 bits integers corresponding to the colors of each ROI. * @param options - Get color map options. * @returns The color map. */ export function getColorMap(options) { const { mode = 'binary' } = options; options = { roiKind: 'bw', ...options }; return match(mode) .with('binary', () => getBinaryMap(options)) .with('saturation', () => getSaturationMap(options)) .with('rainbow', () => getRainbowMap(options)) .exhaustive(); } //# sourceMappingURL=getColorMap.js.map