Convolution2DPass
Methods
buildVertexBuffer
Build the vertex buffer of the screen-aligned quad the convolved result is drawn to.
computeKernelWeight
Sum the kernel components to get the weight the convolved color is divided by. A kernel that sums to zero or less weighs 1, leaving the result unscaled.
| Argument | Type | Required | Description |
|---|---|---|---|
kernel | Array[Number] or TypedArray | Yes | The convolution kernel. |
extend
Method used to decorate a given object (publicAPI+model) with vtkConvolution2DPass characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IConvolution2DPassInitialValues | No | (default: {}) |
getFragmentShaderCode
Generate the fragment shader that convolves the delegate output with a kernel of the given dimension. The kernel is unrolled into the source, so a new dimension needs a new shader.
| Argument | Type | Required | Description |
|---|---|---|---|
kernelDimension | Number | Yes | The width and height of the square kernel. |
getFramebuffer
Get the framebuffer the delegate passes render into, or null before the first traversal.
getKernel
Get the convolution kernel, in row-major form.
getKernelDimension
Get the width and height of the square convolution kernel.
newInstance
Method used to create a new instance of vtkConvolution2DPass.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IConvolution2DPassInitialValues | No | for pre-setting some of its content |
setKernel
Set the convolution kernel. It has to be a flat, row-major array of kernelDimension * kernelDimension components. Setting it to null makes the next traversal rebuild the identity kernel, which leaves the delegate output untouched.
| Argument | Type | Required | Description |
|---|---|---|---|
kernel | Array[Number] or TypedArray | Yes | The convolution kernel. |
setKernelDimension
Set the width and height of the square convolution kernel. It has to be odd, so that the kernel has a center.
| Argument | Type | Required | Description |
|---|---|---|---|
kernelDimension | Number | Yes | The kernel dimension. |