# sp500\_letterbox\_params

```cpp
#include <sp500/letterbox.h>

struct sp500_letterbox_params
```

Letterbox geometry and options.

Fill this with [sp500\_letterbox\_params\_init()](<https://docs.mobilint.com/regulus/en/v4.1/api/cpp/letterbox-h/#sp500-letterbox-params-init>) and then set the fields you care about. `src_w` and `src_h` have no useful default and must be set. Every dimension must be in 1..65535.

## Attributes

| Member | Description |
| --- | --- |
| [`src_w`](<#src-w>) |  |
| [`src_h`](<#src-h>) |  |
| [`dst_w`](<#dst-w>) |  |
| [`dst_h`](<#dst-h>) |  |
| [`channels`](<#channels>) |  |
| [`interp`](<#interp>) |  |
| [`pad_value`](<#pad-value>) |  |
| [`center`](<#center>) |  |
| [`scale_up`](<#scale-up>) |  |
| [`swap_rb`](<#swap-rb>) |  |
| [`reserved`](<#reserved>) |  |

### src\_w

```cpp
int32_t src_w
```

source width in pixels (required)

### src\_h

```cpp
int32_t src_h
```

source height in pixels (required)

### dst\_w

```cpp
int32_t dst_w
```

destination width in pixels; default 640

### dst\_h

```cpp
int32_t dst_h
```

destination height in pixels; default 640

### channels

```cpp
int32_t channels
```

interleaved channels, BGR or RGB = 3; default 3

### interp

```cpp
int32_t interp
```

one of SP500\_RESIZE\_\*; default [SP500\_RESIZE\_BILINEAR](<https://docs.mobilint.com/regulus/en/v4.1/api/cpp/letterbox-h/#sp500-resize-nearest>)

### pad\_value

```cpp
uint8_t pad_value
```

border fill, applied to every channel; default 114

### center

```cpp
uint8_t center
```

1: split the border evenly; 0: pad bottom-right only. Default 1

### scale\_up

```cpp
uint8_t scale_up
```

1: allow upscaling a smaller source; 0: never scale above 1.0. Default 1

### swap\_rb

```cpp
uint8_t swap_rb
```

1: swap channels 0 and 2 while writing, turning BGR into RGB or back. Requires channels == 3. Default 0

### reserved

```cpp
uint32_t reserved[4]
```

must be zero
