No Description

resize_test.go 260B

123456789101112131415161718
  1. package resize
  2. import (
  3. "image"
  4. "image/color"
  5. "testing"
  6. )
  7. func Test_Nearest(t *testing.T) {
  8. img := image.NewGray16(image.Rect(0,0, 3,3))
  9. img.Set(1,1, color.White)
  10. m := Resize(6,-1, img, NearestNeighbor)
  11. if m.At(2,2) != m.At(3,3) {
  12. t.Fail()
  13. }
  14. }