Updated on 2022-03-13 GMT+08:00

SetPaddingParams

Syntax

AIStatus SetPaddingParams(int8_t paddingSwitch,

int32_t paddingSizeTop, int32_t paddingSizeBottom,

int32_t paddingSizeLeft, int32_t paddingSizeRight,

uint32_t batch_index = 0);

Function Description

Sets the padding parameters. The paddingSizeTop, paddingSizeBottom, paddingSizeLeft, and paddingSizeRight4 parameters indicate that padding is added to the top, bottom, left, and right of an image, respectively.

Parameter Description

Parameter

Input/Output

Type

Description

paddingSwitch

Input

Bool

true: Padding is supported. false: Padding is not supported.

paddingSizeTop

Input

int32_t

Padding to the top of an image

paddingSizeBottom

Input

int32_t

Padding to the bottom of an image

paddingSizeLeft

Input

int32_t

Padding to the left of an image

paddingSizeRight

Input

int32_t

Padding to the right of an image

batchIndex

Input

uint32_t

Sequence number of the batch for which padding is performed. The default value is 0. The value range is [0, batchNum).

Return Value

Parameter

Type

Description

-

AIStatus

If the parameter is set successfully, 0 is returned. If the input is invalid, other values are returned.

The AIStatus type is defined as follows:

AIStatus = uint32_t

Exception Handling

None

Restriction

None