# EdgeDetectEffect

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/effects/library/struct-edgedetecteffect/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct EdgeDetectEffect
```

Finds the edges of the content: the 3 by 3 Laplacian kernel of
Effector's `EdgeDetectEffect`, `[-s, -s, -s; -s, 8 s, -s; -s, -s, -s]`
with `s` the strength clamped to 0..2, applied to the colours
un-premultiplied with the alpha kept: flat areas turn black, edges keep
the change of colour across them.

Deviation from Effector, which lays a black line of the response of a
grey copy over the content: that uses the content twice, which a graph
around the content of a visual does not (custom-effects.md, section
3.3); here the response is the output. There is no neutral value (a
transition from no effect switches at half way).

`edge-detect(strength=1)`. The graph is a convolution
(`Edges.KernelMatrix0` to `Edges.KernelMatrix8`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/effects/library.rs#L756)

## Members

- [`strength`](#struct_field-strength)
- [`kernel`](#function-kernel)
- [`convolution`](#function-convolution)

<a id="struct_field-strength"></a>

### strength

```rust
strength: f64
```

How strong the response is, 0 to 2 (default 1).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/effects/library.rs#L758)

<a id="function-kernel"></a>

### kernel

```rust
fn kernel(self: &Self) -> [f32; 9]
```

The kernel, row by row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/effects/library.rs#L769)

<a id="function-convolution"></a>

### convolution

```rust
fn convolution(self: &Self) -> ConvolveMatrix
```

The convolution of the effect.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/effects/library.rs#L775)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- [`CustomEffect`](/docs/0.5.0/api/ferroui-base/media/effects/trait-customeffect/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
