# ArithmeticCompositeEffect

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/effects/struct-arithmeticcompositeeffect/

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

```rust
struct ArithmeticCompositeEffect
```

Combines two sources channel by channel as
`MultiplyAmount * s1 * s2 + Source1Amount * s1 + Source2Amount * s2 + Offset`
on premultiplied colours (Win2D `ArithmeticCompositeEffect`).
Animatable: `MultiplyAmount`, `Source1Amount`, `Source2Amount`, `Offset`.

Drawn when one of the sources is a colour source: the combination is
then a colour matrix of the other source. A factory made from one whose
sources are both images reports
`CompositionEffectFactoryError::EffectTypeNotSupported`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L497)

## Members

- [`name`](#struct_field-name)
- [`multiply_amount`](#struct_field-multiply_amount)
- [`source1_amount`](#struct_field-source1_amount)
- [`source2_amount`](#struct_field-source2_amount)
- [`offset`](#struct_field-offset)
- [`clamp_output`](#struct_field-clamp_output)
- [`source1`](#struct_field-source1)
- [`source2`](#struct_field-source2)

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

### name

```rust
name: String
```

The name of the effect.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L499)

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

### multiply_amount

```rust
multiply_amount: f32
```

The weight of the product of the sources (default 1).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L501)

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

### source1_amount

```rust
source1_amount: f32
```

The weight of the first source (default 0).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L503)

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

### source2_amount

```rust
source2_amount: f32
```

The weight of the second source (default 0).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L505)

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

### offset

```rust
offset: f32
```

The constant added (default 0).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L507)

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

### clamp_output

```rust
clamp_output: bool
```

Whether the output is clamped (stored; the drawing contexts clamp).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L509)

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

### source1

```rust
source1: Option<GraphicsEffectSource>
```

The first input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L511)

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

### source2

```rust
source2: Option<GraphicsEffectSource>
```

The second input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/graphics_effects.rs#L513)

## 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`
- `From<ArithmeticCompositeEffect>`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`

## Availability

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