# EffectImagePixels

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

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

```rust
struct EffectImagePixels
```

The pixels of an [`EffectImage`](/docs/0.5.0/api/ferroui-base/media/effects/struct-effectimage/): premultiplied RGBA, eight bits a
channel, rows of `width * 4` bytes without padding.

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

## Members

- [`new`](#function-new)
- [`width`](#function-width)
- [`height`](#function-height)
- [`rgba`](#function-rgba)
- [`texel`](#function-texel)
- [`sample_stretched`](#function-sample_stretched)

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

### new

```rust
fn new(width: usize, height: usize, rgba: impl Into<Arc<[u8]>>) -> Option<Self>
```

Pixels of `width` by `height` from `rgba` (premultiplied, `width * 4`
bytes a row); `None` when the length does not match.

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

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

### width

```rust
fn width(self: &Self) -> usize
```

The width in pixels.

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

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

### height

```rust
fn height(self: &Self) -> usize
```

The height in pixels.

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

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

### rgba

```rust
fn rgba(self: &Self) -> &[u8]
```

The premultiplied RGBA bytes.

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

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

### texel

```rust
fn texel(self: &Self, x: i64, y: i64) -> [u8; 4]
```

The texel at column `x` and row `y`; transparent beyond the image.

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

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

### sample_stretched

```rust
fn sample_stretched(self: &Self, coord: [f32; 2], layer_size: [f32; 2]) -> [u8; 4]
```

The image at `coord` (device pixels of the area of an effect whose
size is `layer_size`) as the programs of the shader effects sample a
child (the convention of
`ShaderEffectDescription`): the image
stretched over the area, the texel under `coord * size / layer_size`
(single precision, in that order), transparent beyond the image.

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

## 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`

## Availability

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