@thewtex/vtk.js-esm
Version:
Visualization Toolkit for the Web
366 lines (314 loc) • 8.14 kB
TypeScript
import { vtkObject } from '@kitware/vtk.js/interfaces' ;
import { ColorMode } from '@kitware/vtk.js/Rendering/Core/Mapper';
import { Range } from '@kitware/vtk.js/types' ;
export enum VectorMode {
MAGNITUDE,
COMPONENT,
RGBCOLORS
}
export enum ScalarMappingTarget {
LUMINANCE,
LUMINANCE_ALPHA,
RGB,
RGBA
}
/**
*
*/
interface IScalarsToColorsInitialValues {
alpha?: number;
vectorComponent?: number;
vectorSize?: number;
indexedLookup?: boolean;
}
export interface vtkScalarsToColors extends vtkObject {
/**
*
*/
build(): void;
/**
*
* @param value
*/
checkForAnnotatedValue(value: any): number;
/**
*
* @param colors
* @param numComp
* @param numTuples
*/
convertToRGBA(colors: any, numComp: number, numTuples: number): void;
/**
*
*/
getAlpha(): number;
/**
*
* @param {Number} idx
*/
getAnnotatedValue(idx: number): void;
/**
*
* @param val
*/
getAnnotatedValueIndex(val: any): number;
/**
*
* An unsafe version of vtkScalarsToColors::CheckForAnnotatedValue for
* internal use (no pointer checks performed)
* @param value
*/
getAnnotatedValueIndexInternal(value: any): number;
/**
*
* @param {Number} idx
*/
getAnnotation(idx: number): string;
/**
*
* @param val
* @param rgba
*/
getAnnotationColor(val: any, rgba: any): void;
/**
*
* @param val
* @param rgba
*/
getIndexedColor(val: number, rgba: any): void;
/**
*
*/
getIndexedLookup(): boolean;
/**
*
*/
getMappingRange(): Range;
/**
*
*/
getMappingRangeByReference(): Range;
/**
*
*/
getNumberOfAnnotatedValues(): number;
/**
*
*/
getNumberOfAvailableColors(): number;
/**
*
* @param {Number} min
* @param {Number} max
*/
getRange(min: number, max: number): Range;
/**
* Get which component of a vector to map to colors.
*/
getVectorComponent(): number;
/**
*
*/
getVectorMode(): VectorMode;
/**
*
*/
getVectorSize(): number;
/**
*
*/
isOpaque(): boolean;
/**
*
* @param newColors
* @param colors
* @param {Number} alpha
* @param convtFun
*/
luminanceAlphaToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void;
/**
*
* @param newColors
* @param colors
* @param {Number} alpha
* @param convtFun
*/
luminanceToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void;
/**
* Internal methods that map a data array into a 4-component, unsigned char
* RGBA array. The color mode determines the behavior of mapping. If
* ColorMode.DEFAULT is set, then unsigned char data arrays are treated as
* colors (and converted to RGBA if necessary); If ColorMode.DIRECT_SCALARS
* is set, then all arrays are treated as colors (integer types are clamped
* in the range 0-255, floating point arrays are clamped in the range
* 0.0-1.0. Note 'char' does not have enough values to represent a color so
* mapping this type is considered an error); otherwise, the data is mapped
* through this instance of ScalarsToColors. The component argument is used
* for data arrays with more than one component; it indicates which
* component to use to do the blending. When the component argument is -1,
* then the this object uses its own selected technique to change a vector
* into a scalar to map.
* @param scalars
* @param {ColorMode} colorMode
* @param {Number} componentIn
*/
mapScalars(scalars: any, colorMode: ColorMode, componentIn: number): void;
/**
* Map a set of vector values through the table
* @param input
* @param output
* @param {ScalarMappingTarget} outputFormat
* @param vectorComponentIn
* @param {Number} vectorSizeIn
*/
mapVectorsThroughTable(input: any, output: any, outputFormat: ScalarMappingTarget, vectorComponentIn: number, vectorSizeIn: number): void;
/**
*
* @param input
* @param output
* @param {Number} compsToUse
*/
mapVectorsToMagnitude(input: any, output: any, compsToUse: number): void;
/**
*
* @param newColors
* @param colors
* @param {Number} alpha
* @param convtFun
*/
rGBAToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void;
/**
*
* @param newColors
* @param colors
* @param {Number} alpha
* @param convtFun
*/
rGBToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void;
/**
*
* @param value
*/
removeAnnotation(value: any): boolean;
/**
*
*/
resetAnnotations(): void;
/**
*
* @param {Number} alpha
*/
setAlpha(alpha: number): boolean;
/**
*
* @param value
* @param annotation
*/
setAnnotation(value: any, annotation: any): number;
/**
*
* @param values
* @param annotations
*/
setAnnotations(values: any, annotations: any): void;
/**
*
* @param {Boolean} indexedLookup
*/
setIndexedLookup(indexedLookup: boolean): boolean;
/**
*
* @param {Range} mappingRange
*/
setMappingRange(mappingRange: Range): boolean;
/**
*
* @param {Number} min
* @param {Number} max
*/
setMappingRange(min: number, max: number): boolean;
/**
*
* @param {Range} mappingRange
*/
setMappingRangeFrom(mappingRange: Range): boolean;
/**
*
* @param {Number} min
* @param {Number} max
*/
setRange(min: number, max: number): boolean;
/**
*
* @param {Number} vectorComponent
*/
setVectorComponent(vectorComponent:number): boolean;
/**
*
*/
setVectorModeToMagnitude(): boolean;
/**
*
*/
setVectorModeToComponent(): boolean;
/**
* When mapping vectors, consider only the number of components selected by
* `vectorSize` to be part of the vector, and ignore any other components. Set
* to -1 to map all components. If this is not set to -1, then you can use
* `setVectorComponent` to set which scalar component will be the first
* component in the vector to be mapped.
*/
setVectorModeToRGBColors(): boolean;
/**
*
* @param {Number} vectorSize
*/
setVectorSize(vectorSize: number): boolean;
/**
*
*/
updateAnnotatedValueMap(): boolean;
/**
*
*/
usingLogScale(): boolean;
}
/**
* Method used to decorate a given object (publicAPI+model) with vtkScalarsToColors characteristics.
*
* @param publicAPI object on which methods will be bounds (public)
* @param model object on which data structure will be bounds (protected)
* @param {IScalarsToColorsInitialValues} [initialValues] (default: {})
*/
export function extend(publicAPI: object, model: object, initialValues?: IScalarsToColorsInitialValues): void;
/**
* Method used to create a new instance of vtkScalarsToColors
* @param {IScalarsToColorsInitialValues} [initialValues] for pre-setting some of its content
*/
export function newInstance(initialValues?: IScalarsToColorsInitialValues): vtkScalarsToColors;
/**
* vtkScalarsToColors is a general-purpose base class for objects that convert
* scalars to colors. This include vtkLookupTable classes and color transfer
* functions. By itself, this class will simply rescale the scalars.
*
* The scalar-to-color mapping can be augmented with an additional uniform alpha
* blend. This is used, for example, to blend a vtkActor's opacity with the
* lookup table values.
*
* Specific scalar values may be annotated with text strings that will be
* included in color legends using `setAnnotations`, `setAnnotation`,
* `getNumberOfAnnotatedValues`, `getAnnotatedValue`, `getAnnotation`,
* `removeAnnotation`, and `resetAnnotations`.
*
* This class also has a method for indicating that the set of annotated values
* form a categorical color map; by setting IndexedLookup to true, you indicate
* that the annotated values are the only valid values for which entries in the
* color table should be returned. In this mode, subclasses should then assign
* colors to annotated values by taking the modulus of an annotated value's
* index in the list of annotations with the number of colors in the table.
*/
export declare const vtkScalarsToColors: {
newInstance: typeof newInstance;
extend: typeof extend;
}
export default vtkScalarsToColors;