Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PaddingGray ¶
func PaddingGray(img *image.Gray, kernelSize image.Point, anchor image.Point, border Border) (*image.Gray, error)
PaddingGray appends padding to a given grayscale image. The size of the padding is calculated from the kernel size and the anchor point. Supported border types are: BorderConstant, BorderReplicate, BorderReflect. Example of usage:
res, err := padding.PaddingGray(img, {5, 5}, {1, 1}, BorderReflect)
Note: this will add a 1px padding for the top and left borders of the image and a 3px padding fot the bottom and right borders of the image.
func PaddingRGBA ¶
func PaddingRGBA(img *image.RGBA, kernelSize image.Point, anchor image.Point, border Border) (*image.RGBA, error)
PaddingRGBA appends padding to a given RGBA image. The size of the padding is calculated from the kernel size and the anchor point. Supported border types are: BorderConstant, BorderReplicate, BorderReflect. Example of usage:
res, err := padding.PaddingRGBA(img, {5, 5}, {1, 1}, BorderReflect)
Note: this will add a 1px padding for the top and left borders of the image and a 3px padding fot the bottom and right borders of the image.
Types ¶
type Paddings ¶
type Paddings struct { // PaddingLeft is the size of the left padding PaddingLeft int // PaddingRight is the size of the right padding PaddingRight int // PaddingTop is the size of the top padding PaddingTop int // PaddingBottom is the size of the bottom padding PaddingBottom int }
Paddings struct holds the padding sizes for each padding