Function vizia::vg::image_filters::matrix_convolution
pub fn matrix_convolution(
kernel_size: impl Into<ISize>,
kernel: &[f32],
gain: f32,
bias: f32,
kernel_offset: impl Into<IPoint>,
tile_mode: SkTileMode,
convolve_alpha: bool,
input: impl Into<Option<RCHandle<SkImageFilter>>>,
crop_rect: impl Into<CropRect>,
) -> Option<RCHandle<SkImageFilter>>
Expand description
Create a filter that applies an NxM image processing kernel to the input image. This can be used to produce effects such as sharpening, blurring, edge detection, etc.
kernel_size
- The kernel size in pixels, in each dimension (N by M).kernel
- The image processing kernel. Must contain N * M elements, in row order.gain
- A scale factor applied to each pixel after convolution. This can be used to normalize the kernel, if it does not already sum to 1.bias
- A bias factor added to each pixel after convolution.kernel_offset
- An offset applied to each pixel coordinate before convolution. This can be used to center the kernel over the image (e.g., a 3x3 kernel should have an offset of {1, 1}).tile_mode
- How accesses outside the image are treated.convolve_alpha
- Iftrue
, all channels are convolved. Iffalse
, only the RGB channels are convolved, and alpha is copied from the source image.input
- The input image filter, if null the source bitmap is used instead.crop_rect
- Optional rectangle to which the output processing will be limited.