UNPKG

@kitware/vtk.js

Version:

Visualization Toolkit for the Web

18 lines (15 loc) 795 B
// See typescript header for documentation function getTransferFunctionsHash(transferFunctions, useIndependentComponents, numberOfComponents) { return transferFunctions.length > 0 ? `${transferFunctions.map(tf => tf?.getMTime() ?? 'x').join('/')}-${useIndependentComponents}-${numberOfComponents}` : '0'; } function getImageDataHash(image, scalars) { // Don't use the image data, as the scalars will define the texture // If using the image data in the hash, it will cause issues when two image data // using the same scalars are in the same mapper (for example the VolumeMapper) return `${scalars.getMTime()}`; } var resourceSharingHelper = { getTransferFunctionsHash, getImageDataHash }; export { resourceSharingHelper as default, getImageDataHash, getTransferFunctionsHash };