https://github.com/davidbyttow/govips Option
// Option is a type that is passed to internal libvips functions
type Option struct {
Name string
ref interface{}
gvalue C.GValue
closer func(gv *C.GValue)
output bool
}
Fail to figure out how I can add a Option to embed in Go to set the white background
x := 100 - imgRef.Width()/2
y := 100 - imgRef.Height()/2
img, err := vips.Embed(imgRef.Image(), x, y, 200, 200, background)
I only know it's possible looking at de cli verion, but how to translate it into a Go Option struct is a mystery for me
$ vips embed
embed an image in a larger image
usage:
embed in out x y width height
where:
in - Input image, input VipsImage
out - Output image, output VipsImage
x - Left edge of input in output, input gint
default: 0
min: -1000000000, max: 1000000000
y - Top edge of input in output, input gint
default: 0
min: -1000000000, max: 1000000000
width - Image width in pixels, input gint
default: 1
min: 1, max: 1000000000
height - Image height in pixels, input gint
default: 1
min: 1, max: 1000000000
optional arguments:
extend - How to generate the extra pixels, input VipsExtend
default: black
allowed: black, copy, repeat, mirror, white, background
background - Colour for background pixels, input VipsArrayDouble
operation flags: sequential-unbuffered