import Histogram from "./Histogram.js"; export declare const LUT_ENTRIES = 256; export declare const LUT_ARRAY_LENGTH: number; /** * @typedef {Object} ControlPoint Used for the TF (transfer function) editor GUI. * Need to be converted to LUT for rendering. * @property {number} x The X Coordinate: an intensity value, normalized to the 0-255 range * @property {number} opacity The Opacity, from 0 to 1 * @property {Array.} color The Color, 3 numbers from 0-255 for r,g,b */ export type ControlPoint = { x: number; opacity: number; color: [number, number, number]; }; /** * @typedef {Object} Lut Used for rendering. The start and end of the Lut represent the min and max of the data. * @property {Array.} lut LUT_ARRAY_LENGTH element lookup table as array * (maps scalar intensity to a rgb color plus alpha, with each value from 0-255) * @property {Array.} controlPoints */ export declare class Lut { lut: Uint8Array; controlPoints: ControlPoint[]; constructor(); /** * Generate a piecewise linear lookup table that ramps up from 0 to 1 over the b to e domain. * If e === b, then we use a step function with f(b) = 0 and f(b + 1) = 1 * | * 1| +---------+----- * | / * | / * | / * | / * | / * 0+=========+---------------+----- * 0 b e 255 * @return {Lut} * @param {number} b * @param {number} e */ createFromMinMax(b: number, e: number): Lut; createFullRange(): Lut; /** * Generate a Window/level lookup table * @return {Lut} * @param {number} wnd in 0..1 range * @param {number} lvl in 0..1 range */ createFromWindowLevel(wnd: number, lvl: number): Lut; createFromControlPoints(controlPoints: ControlPoint[]): Lut; /** * Generate an "equalized" lookup table * @return {Lut} */ createFromEqHistogram(histogram: Histogram): Lut; /** * Generate a lookup table with a different color per intensity value. * This translates to a unique color per histogram bin with more than zero pixels. * TODO THIS IS NOT THE EFFECT WE WANT. Colorize should operate on actual data values, not histogram bins. * @return {Lut} */ createLabelColors(histogram: Histogram): Lut; remapDomains(oldMin: number, oldMax: number, newMin: number, newMax: number): void; } export declare function remapLut(lut: Uint8Array, oldMin: number, oldMax: number, newMin: number, newMax: number): Uint8Array; export declare function remapControlPoints(controlPoints: ControlPoint[], oldMin: number, oldMax: number, newMin: number, newMax: number, nudgeEndPoints?: boolean): ControlPoint[];