filter_gaussian_blur: Filter: add a gaussian blur to an element

Description Usage Arguments Value Examples

View source: R/filters.R

Description

A gaussian blur effectively blurs an input image or shape by the amount specified in stdev. The standard deviation of stdev is in direct reference to the gaussian distribution that governs the extent of blurring.

Usage

1
filter_gaussian_blur(stdev = 1, what = "source")

Arguments

stdev

The number of standard deviations for the blur effect.

what

What exactly should be blurred? By default, it is the "source" image.

Value

An svg object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
if (interactive()) {

# Add a green ellipse to an SVG and
# then apply the `filter_gaussian_blur()`
# filter to blur the edges
SVG(width = 200, height = 100) %>%
  svg_filter(
    id = "blur",
    filters = list(
      filter_gaussian_blur(stdev = 2)
    )
  ) %>%
  svg_ellipse(
    x = 40, y = 40,
    width = 50, height = 30,
    attrs = svg_attrs_pres(
      fill = "green",
      filter = "blur"
    )
  )
}

omsvg documentation built on Feb. 10, 2021, 5:10 p.m.