MakeBorderConfig

Description

Defines the padding configuration for image processing. You can set the numbers of pixels for left, right, top, and bottom padding, padding color constants, and padding mode.

Structure Definition

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
struct MakeBorderConfig {
    enum BorderType {
        BORDER_CONSTANT = 0,
        BORDER_REPLICATE,
        BORDER_REFLECT,
        BORDER_REFLECT_101
    };
    uint32_t left;
    uint32_t right;
    uint32_t top;
    uint32_t bottom;
    uint32_t channel_zero;
    uint32_t channel_one;
    uint32_t channel_two;
    BorderType borderType;
};

Parameters

Parameter

Input/Output

Description

left

Input

Number of pixels for left padding

right

Input

Number of pixels for right padding

top

Input

Number of pixels for top padding

bottom

Input

Number of pixels for bottom padding

channel_zero

Input

Value of channel 0. Must be in the range of [0, 255].

channel_one

Input

Value of channel 1. Must be in the range of [0, 255].

channel_two

Input

Value of channel 2. Must be in the range of [0, 255].

borderType

Input

Padding mode.

  • BORDER_CONSTANT: Constant colored border.
  • BORDER_REPLICATE: Last element replicated throughout.

    For example, aaaaaa|a*****h|hhhhhhh (where * indicates any image element).

  • BORDER_REFLECT: Reflection of border elements (included).

    For example, ba|abc*******fgh|hg (where * indicates any image element).

  • BORDER_REFLECT_101: Reflection of border elements (excluded).

    For example, cb|abc****fgh|gf (where * indicates any image element).

channel_zero, channel_one, and channel_two correspond to the image channels. For example, when RGB is used, channel_zero corresponds to channel R, channel_one corresponds to channel G, and channel_two corresponds to channel B.