# SharpenEffect

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

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

```rust
struct SharpenEffect
```

Sharpens the content (Effector's `SharpenEffect`): the 3 by 3 kernel
`[0, -s, 0; -s, 1 + 4 s, -s; 0, -s, 0]` with `s` the strength clamped
to 0..2, the four premultiplied channels convolved, transparent beyond
the edges.

`sharpen(strength=1)`. The graph is a convolution (Win2D's
`ConvolveMatrixEffect`, `Sharpen.KernelMatrix0` to
`Sharpen.KernelMatrix8`), whose kernel steps over device pixels.

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

## Members

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

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

### strength

```rust
strength: f64
```

How much, 0 (unchanged) to 2 (default 1).

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

<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#L696)

<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#L702)

## 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/).
