Ejemplo n.º 1
0
func main() {
	im := load()
	resize(im, newResizeFuncNfnt(nfnt_resize.NearestNeighbor), "nfnt_nearest_neighbor.png")
	resize(im, newResizeFuncNfnt(nfnt_resize.Bilinear), "nfnt_bilinear.png")
	resize(im, newResizeFuncNfnt(nfnt_resize.Bicubic), "nfnt_bicubic.png")
	resize(im, newResizeFuncNfnt(nfnt_resize.MitchellNetravali), "nfnt_mitchell_netravali.png")
	resize(im, newResizeFuncNfnt(nfnt_resize.Lanczos2), "nfnt_lanczos2.png")
	resize(im, newResizeFuncNfnt(nfnt_resize.Lanczos3), "nfnt_lanczos3.png")
	resize(im, newResizeFuncXDraw(x_draw.NearestNeighbor), "x_draw_nearest_neighbor.png")
	resize(im, newResizeFuncXDraw(x_draw.ApproxBiLinear), "x_draw_approx_bilinear.png")
	resize(im, newResizeFuncXDraw(x_draw.BiLinear), "x_draw_bilinear.png")
	resize(im, newResizeFuncXDraw(x_draw.CatmullRom), "x_draw_catmull_rom.png")
	resize(im, newResizeFuncImaging(imaging.NearestNeighbor), "imaging_nearest_neighbor.png")
	resize(im, newResizeFuncImaging(imaging.Box), "imaging_box.png")
	resize(im, newResizeFuncImaging(imaging.Linear), "imaging_linear.png")
	resize(im, newResizeFuncImaging(imaging.MitchellNetravali), "imaging_mitchell_netravali.png")
	resize(im, newResizeFuncImaging(imaging.CatmullRom), "imaging_catmull_rom.png")
	resize(im, newResizeFuncImaging(imaging.Gaussian), "imaging_gaussian.png")
	resize(im, newResizeFuncImaging(imaging.Lanczos), "imaging_lanczos.png")
	resize(im, newResizeFuncGift(gift.NearestNeighborResampling), "gift_nearest_neighbor.png")
	resize(im, newResizeFuncGift(gift.BoxResampling), "gift_box.png")
	resize(im, newResizeFuncGift(gift.LinearResampling), "gift_linear.png")
	resize(im, newResizeFuncGift(gift.CubicResampling), "gift_cubic.png")
	resize(im, newResizeFuncGift(gift.LanczosResampling), "gift_lanczos.png")
	func() {
		defer func() {
			err := recover()
			if err != nil {
				fmt.Printf("error with rez: %s\n", err)
			}
		}()
		resize(im, newResizeFuncRez(rez.NewBilinearFilter()), "rez_bilinear.png")
		resize(im, newResizeFuncRez(rez.NewBicubicFilter()), "rez_bicubic.png")
		resize(im, newResizeFuncRez(rez.NewLanczosFilter(2)), "rez_lanczos2.png")
		resize(im, newResizeFuncRez(rez.NewLanczosFilter(3)), "rez_lanczos3.png")
	}()
}
Ejemplo n.º 2
0
func BenchmarkRezLanczos3(b *testing.B) {
	benchmarkRez(b, rez.NewLanczosFilter(3))
}