mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 09:20:29 -07:00
vips: add a vips__gaussblur method
handle both < 7.41 and higher. Prior 7.41, vips_gaussblur took only a int param, the radius. The radius was then divided by 2.0 (min_ampl) in vips_gaussblur. After, you can now parameter the min_ampl and radius became sigma (and passed from an integer to a double).
This commit is contained in:
parent
0f31f20ded
commit
404cbf902f
3 changed files with 29 additions and 0 deletions
11
vips.go
11
vips.go
|
|
@ -432,3 +432,14 @@ func boolToInt(b bool) int {
|
|||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func vipsGaussianBlur(image *C.VipsImage, o GaussianBlur) (*C.VipsImage, error) {
|
||||
var out *C.VipsImage
|
||||
defer C.g_object_unref(C.gpointer(image))
|
||||
|
||||
err := C.vips__gaussblur(image, &out, C.double(o.Sigma), C.double(o.MinAmpl))
|
||||
if err != 0 {
|
||||
return nil, catchVipsError()
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue