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 name
string 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 mode
string Mode category to modify
id
string 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 name
string Base name of uniform variable
value
number | 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 inDomain
Array.<number> <optional>
[] Input value range [min, max] for mapping
channelWeights
Array.<number> <optional>
[1/3, 1/3, 1/3] RGB channel weights for grayscale conversion
maxSteps
number <optional>
256 Number of discrete steps in the colormap texture