GlyphField.getColormapForBinding¶
Summary¶
GlyphField.getColormapForBinding returns the current colormap for binding value derived from this GlyphField runtime state.
Syntax¶
Parameters¶
This API does not take parameters.
Returns¶
Colormap - Colormap runtime object for scalar-to-color mapping on CPU and GPU paths.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const glyphField = wgpu.createGlyphField({ instanceCount: 1, positions: new Float32Array([0, 0, 0, 0]), rotations: new Float32Array([0, 0, 0, 1]), scales: new Float32Array([1, 1, 1, 0]), attributes: new Float32Array([0.5, 0, 0, 0]), scaleTransform: { mode: "linear", domainMin: 0, domainMax: 1 } });
const result = glyphField.getColormapForBinding();
console.log(result);
console.log(result.sampleCPU(0.5));
See Also¶
- GlyphField.applyScaleStats
- GlyphField.colormap
- GlyphField.colormapStops
- GlyphField.colorMode
- GlyphField.computeBoundsFromCPUData
- GlyphField.destroy
- GlyphField.dirtyUniforms
- GlyphField.getAttributeRecord
- GlyphField.getBounds
- GlyphField.getColormapKey
- GlyphField.getLocalBounds
- GlyphField.getScaleSourceDescriptor