# PixelFormat

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/platform/struct-pixelformat/

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

```rust
struct PixelFormat
```

The format of the pixels of a bitmap or framebuffer.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L26)

## Members

- [`RGB565`](#assoc_const-rgb565)
- [`RGBA8888`](#assoc_const-rgba8888)
- [`RGB32`](#assoc_const-rgb32)
- [`BGRA8888`](#assoc_const-bgra8888)
- [`bits_per_pixel`](#function-bits_per_pixel)
- [`has_alpha`](#function-has_alpha)

<a id="assoc_const-rgb565"></a>

### RGB565

```rust
const RGB565: PixelFormat
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L31)

<a id="assoc_const-rgba8888"></a>

### RGBA8888

```rust
const RGBA8888: PixelFormat
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L32)

<a id="assoc_const-rgb32"></a>

### RGB32

```rust
const RGB32: PixelFormat
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L33)

<a id="assoc_const-bgra8888"></a>

### BGRA8888

```rust
const BGRA8888: PixelFormat
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L34)

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

### bits_per_pixel

```rust
fn bits_per_pixel(self: &Self) -> u32
```

The number of bits one pixel occupies.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L42)

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

### has_alpha

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

Whether the format carries an alpha channel.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/pixel_format.rs#L57)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`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`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Display`

## Availability

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