19 lines
260 B
Go
19 lines
260 B
Go
|
package resize
|
||
|
|
||
|
import (
|
||
|
"image"
|
||
|
"image/color"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func Test_Nearest(t *testing.T) {
|
||
|
img := image.NewGray16(image.Rect(0,0, 3,3))
|
||
|
img.Set(1,1, color.White)
|
||
|
|
||
|
m := Resize(6,-1, img, NearestNeighbor)
|
||
|
|
||
|
if m.At(2,2) != m.At(3,3) {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|