# TransformOperation

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/transformation/struct-transformoperation/

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

```rust
struct TransformOperation
```

Represents a single primitive transform (like translation, rotation,
scale, etc.).

The default value is a translation by zero whose matrix is all zeros; call
`bake` after setting the type and data.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L105)

## Members

- [`type_`](#struct_field-type_)
- [`matrix`](#struct_field-matrix)
- [`data`](#struct_field-data)
- [`is_identity`](#function-is_identity)
- [`bake`](#function-bake)
- [`identity`](#function-identity)
- [`try_interpolate`](#function-try_interpolate)

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

### type_

```rust
type_: OperationType
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L106)

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

### matrix

```rust
matrix: crate::Matrix
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L107)

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

### data

```rust
data: DataLayout
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L108)

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

### is_identity

```rust
fn is_identity(self: &Self) -> bool
```

Returns whether the operation produces the identity matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L114)

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

### bake

```rust
fn bake(self: &mut Self)
```

Bakes this operation to a transform matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L119)

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

### identity

```rust
fn identity() -> TransformOperation
```

Returns a new identity operation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L140)

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

### try_interpolate

```rust
fn try_interpolate(from: Option<TransformOperation>, to: Option<TransformOperation>, progress: f64, result: &mut TransformOperation) -> bool
```

Attempts to interpolate between two transform operations. Returns
false if the operations cannot be interpolated.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/transformation/transform_operation.rs#L146)

## 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`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`

## Availability

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