Commit Graph

52 Commits

Author SHA1 Message Date
Nigel Tao
2a1231edb8 draw: factor out the Scale implementations.
This is just a copy/paste/rename in anticipation of automatically
generating fast-path code for specific dst-image types and src-image
types, a la the standard library's image/draw package.

Change-Id: If6385b347cb5e1d134b0ce841ef38ed4450a6fef
Reviewed-on: https://go-review.googlesource.com/5252
Reviewed-by: David Symonds <dsymonds@golang.org>
2015-02-20 07:27:42 +00:00
Nigel Tao
96b77d5c7a draw: new package, a superset of the standard library's image/draw
package, including the ability to scale an image.

Design discussion:
https://groups.google.com/forum/#!topic/golang-dev/B7-OrWdheic

Previous code review (when Go used hg instead of git):
https://codereview.appspot.com/101670045

New benchmarks:
BenchmarkScaleLargeDownNN	     300	   5935174 ns/op
BenchmarkScaleLargeDownAB	     100	  14482372 ns/op
BenchmarkScaleLargeDownBL	       1	1383805986 ns/op
BenchmarkScaleLargeDownCR	       1	2724631789 ns/op
BenchmarkScaleDownNN     	    1000	   1850500 ns/op
BenchmarkScaleDownAB     	     300	   4413499 ns/op
BenchmarkScaleDownBL     	      50	  30498748 ns/op
BenchmarkScaleDownCR     	      20	  58349653 ns/op
BenchmarkScaleUpNN       	      20	  92306475 ns/op
BenchmarkScaleUpAB       	       5	 220103753 ns/op
BenchmarkScaleUpBL       	      10	 122635195 ns/op
BenchmarkScaleUpCR       	      10	 183275927 ns/op

Change-Id: I69d397e68897bae024c7b330a9375fa3e7688591
Reviewed-on: https://go-review.googlesource.com/4210
Reviewed-by: Rob Pike <r@golang.org>
2015-02-17 23:20:02 +00:00