|
|
@@ -8,11 +8,12 @@ import (
|
|
|
|
|
|
var img = image.NewGray16(image.Rect(0, 0, 3, 3))
|
|
|
|
|
|
-func Test_Nearest(t *testing.T) {
|
|
|
+func init() {
|
|
|
img.Set(1, 1, color.White)
|
|
|
+}
|
|
|
|
|
|
+func Test_Nearest(t *testing.T) {
|
|
|
m := Resize(6, 0, img, NearestNeighbor)
|
|
|
-
|
|
|
if m.At(2, 2) != m.At(3, 3) {
|
|
|
t.Fail()
|
|
|
}
|
|
|
@@ -40,3 +41,8 @@ func Test_ZeroImg(t *testing.T) {
|
|
|
t.Fail()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func Benchmark_BigResize(b *testing.B) {
|
|
|
+ m := Resize(1000, 1000, img, Lanczos3)
|
|
|
+ m.At(0, 0)
|
|
|
+}
|