Module image_filters

Source

Structs§

ArithmeticFPInputs
CropRect
This is just a convenience type to allow passing IRects, Rects, and optional references to those types as a crop rect for the image filter factories. It’s not intended to be used directly.

Enums§

Dither

Functions§

arithmetic
Create a filter that implements a custom blend mode. Each output pixel is the result of combining the corresponding background and foreground pixels using the 4 coefficients: k1 * foreground * background + k2 * foreground + k3 * background + k4
blend
This filter takes an crate::BlendMode and uses it to composite the two filters together.
blur
Create a filter that blurs its input by the separate X and Y sigmas. The provided tile mode is used when the blur kernel goes outside the input image.
color_filter
compose
Create a filter that composes ‘inner’ with ‘outer’, such that the results of ‘inner’ are treated as the source bitmap passed to ‘outer’, i.e. result = outer(inner(source)).
crop
Create a filter that applies a crop to the result of the ‘input’ filter. Pixels within the crop rectangle are unmodified from what ‘input’ produced. Pixels outside of crop match the provided TileMode (defaulting to Decal).
dilate
Create a filter that dilates each input pixel’s channel values to the max value within the given radii along the x and y axes.
displacement_map
Create a filter that moves each pixel in its color input based on an (x,y) vector encoded in its displacement input filter. Two color components of the displacement image are mapped into a vector as scale * (color[xChannel], color[yChannel]), where the channel selectors are one of R, G, B, or A.
distant_lit_diffuse
Create a filter that calculates the diffuse illumination from a distant light source, interpreting the alpha channel of the input as the height profile of the surface (to approximate normal vectors).
distant_lit_specular
Create a filter that calculates the specular illumination from a distant light source, interpreting the alpha channel of the input as the height profile of the surface (to approximate normal vectors).
drop_shadow
Create a filter that draws a drop shadow under the input content. This filter produces an image that includes the inputs’ content.
drop_shadow_only
Create a filter that renders a drop shadow, in exactly the same manner as ::DropShadow, except that the resulting image does not include the input content. This allows the shadow and input to be composed by a filter DAG in a more flexible manner.
empty
Create a filter that always produces transparent black.
erode
Create a filter that erodes each input pixel’s channel values to the minimum channel value within the given radii along the x and y axes.
image
Create a filter that draws the ‘src_rect’ portion of image into ‘dst_rect’ using the given filter quality. Similar to crate::Canvas::draw_image_rect().
magnifier
Create a filter that fills ‘lens_bounds’ with a magnification of the input.
matrix_convolution
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.
matrix_transform
Create a filter that transforms the input image by ‘matrix’. This matrix transforms the local space, which means it effectively happens prior to any transformation coming from the crate::Canvas initiating the filtering.
merge
Create a filter that merges the filters together by drawing their results in order with src-over blending.
offset
Create a filter that offsets the input filter by the given vector.
picture
Create a filter that produces the Picture as its output, clipped to both ‘target_rect’ and the picture’s internal cull rect.
point_lit_diffuse
Create a filter that calculates the diffuse illumination from a point light source, using alpha channel of the input as the height profile of the surface (to approximate normal vectors).
point_lit_specular
Create a filter that calculates the specular illumination from a point light source, using alpha channel of the input as the height profile of the surface (to approximate normal vectors).
runtime_shader
shader
Create a filter that fills the output with the per-pixel evaluation of the Shader. The shader is defined in the image filter’s local coordinate system, so will automatically be affected by [Canvas'] transform.
shader_with_dither
spot_lit_diffuse
Create a filter that calculates the diffuse illumination from a spot light source, using alpha channel of the input as the height profile of the surface (to approximate normal vectors). The spot light is restricted to be within ‘cutoff_angle’ of the vector between the location and target.
spot_lit_specular
Create a filter that calculates the specular illumination from a spot light source, using alpha channel of the input as the height profile of the surface (to approximate normal vectors). The spot light is restricted to be within ‘cutoff_angle’ of the vector between the location and target.
tile
Create a tile image filter.