-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconvolution_test.go
More file actions
36 lines (33 loc) · 847 Bytes
/
convolution_test.go
File metadata and controls
36 lines (33 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package govips
import (
_ "image/jpeg"
"testing"
)
func Test_Blur(t *testing.T) {
err := Initialize()
defer ThreadShutdown()
defer checkErrorBuffer(t)
checkError(t, err)
vi := test_DecodeJpegVips(t, "benchmark_images/1.jpg", BENCHMARK_IMAGE_1_BOUNDS, nil)
defer vi.Free()
vi2, err := Blur(vi, 5, nil)
checkError(t, err)
defer vi2.Free()
if BENCHMARK_IMAGE_1_BOUNDS != vi2.Bounds() {
t.Fatalf("Invalid bounds: %v", vi2.Bounds())
}
}
func Test_Sharpen(t *testing.T) {
err := Initialize()
defer ThreadShutdown()
defer checkErrorBuffer(t)
checkError(t, err)
vi := test_DecodeJpegVips(t, "benchmark_images/1.jpg", BENCHMARK_IMAGE_1_BOUNDS, nil)
defer vi.Free()
vi2, err := Sharpen(vi, nil)
checkError(t, err)
defer vi2.Free()
if BENCHMARK_IMAGE_1_BOUNDS != vi2.Bounds() {
t.Fatalf("Invalid bounds: %v", vi2.Bounds())
}
}