Skip to content

sp500_letterbox_params

#include <sp500/letterbox.h>

struct sp500_letterbox_params

Letterbox geometry and options.

Fill this with 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_h
dst_w
dst_h
channels
interp
pad_value
center
scale_up
swap_rb
reserved

src_w

int32_t src_w

source width in pixels (required)

src_h

int32_t src_h

source height in pixels (required)

dst_w

int32_t dst_w

destination width in pixels; default 640

dst_h

int32_t dst_h

destination height in pixels; default 640

channels

int32_t channels

interleaved channels, BGR or RGB = 3; default 3

interp

int32_t interp

one of SP500_RESIZE_*; default SP500_RESIZE_BILINEAR

pad_value

uint8_t pad_value

border fill, applied to every channel; default 114

center

uint8_t center

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

scale_up

uint8_t scale_up

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

swap_rb

uint8_t swap_rb

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

reserved

uint32_t reserved[4]

must be zero