Padding

class Padding(top: Int, bottom: Int, left: Int, right: Int, mode: PaddingMode) : ImagePreprocessorBase

This image preprocessor defines the Pad operation.

Pad operation pads the given image on all sides according to the provided PaddingMode.

Constructors

Padding
Link copied to clipboard
fun Padding(top: Int = 0, bottom: Int = 0, left: Int = 0, right: Int = 0, mode: PaddingMode = PaddingMode.Black)

Functions

apply
Link copied to clipboard
open override fun apply(image: BufferedImage): BufferedImage

Transforms provided input image.

getOutputShape
Link copied to clipboard
open override fun getOutputShape(inputShape: ImageShape): ImageShape

Computes output image shape for the provided inputShape. Note that some input dimensions could equal to null, which means that they are undefined. This is useful for the operations with fixed output size not dependent on the input size.

Properties

bottom
Link copied to clipboard
var bottom: Int = 0

The number of pixels to add to the bottom.

left
Link copied to clipboard
var left: Int = 0

The number of pixels to add to the left.

mode
Link copied to clipboard
var mode: PaddingMode

The kind of padding to use.

right
Link copied to clipboard
var right: Int = 0

The number of pixels to add to the right.

top
Link copied to clipboard
var top: Int = 0

The number of pixels to add to the top.