new ShaderFilterColormap(colorscale [, options])
Creates a new colormap filter
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
colorscale |
ColorScale | Colorscale object defining the mapping |
|||||||||||||||||||||
options |
ShaderFilterColormap~Options |
<optional> |
Configuration options Properties
|
- Source:
Throws:
-
If inDomain is invalid (length !== 2 or min >= max)
- Type
- Error
Example
```javascript
// Create with custom domain and weights
const filter = new ShaderFilterColormap(colorscale, {
inDomain: [0, 100],
channelWeights: [0.2126, 0.7152, 0.0722], // Perceptual weights
maxSteps: 512
});
```
Extends
Methods
-
getSampler(name)
-
Finds a sampler by name
Parameters:
Name Type Description namestring Base sampler name
- Inherited From:
- Overrides:
- Source:
Returns:
Found sampler or undefined
- Type
- ShaderFilter~Sampler | undefined
-
setMode(mode, id)
-
Sets the active mode for the filter
Parameters:
Name Type Description modestring Mode category to modify
idstring Specific mode ID to enable
- Inherited From:
- Overrides:
- Source:
Throws:
-
If shader not registered or mode doesn't exist
- Type
- Error
-
setUniform(name, value)
-
Sets a uniform variable value
Parameters:
Name Type Description namestring Base name of uniform variable
valuenumber | boolean | Array Value to set
- Inherited From:
- Overrides:
- Source:
Throws:
-
If shader not registered
- Type
- Error
Type Definitions
-
Options
-
Configuration options for colormap filter
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description inDomainArray.<number> <optional>
[] Input value range [min, max] for mapping
channelWeightsArray.<number> <optional>
[1/3, 1/3, 1/3] RGB channel weights for grayscale conversion
maxStepsnumber <optional>
256 Number of discrete steps in the colormap texture