Go to file
Dmitri Shuralyov 249dc8530c draw: re-enable the image.Rectangle DstMask fast path
This change reverts the remaining part of CL 9463,
the image.Rectangle DstMask fast path, since Go 1.5
has been released.

	$ go test -bench=. -count=5 -timeout=1h > before.txt
	$ # apply change
	$ go test -bench=. -count=5 -timeout=1h > after.txt
	$ benchstat before.txt after.txt
	name                    old time/op    new time/op    delta
	SimpleScaleCopy-8         23.4µs ± 3%    21.8µs ± 4%   -7.14%  (p=0.016 n=5+5)
	SimpleTransformCopy-8     22.6µs ± 6%    21.4µs ± 1%   -5.07%  (p=0.008 n=5+5)
	SimpleTransformScale-8     904µs ± 0%     900µs ± 0%     ~     (p=0.056 n=5+5)
	ScaleNNLargeDown-8         641µs ± 1%     643µs ± 1%     ~     (p=0.548 n=5+5)
	ScaleABLargeDown-8        1.50ms ± 1%    1.50ms ± 1%     ~     (p=0.413 n=5+4)
	ScaleBLLargeDown-8         192ms ± 5%     196ms ± 4%     ~     (p=0.095 n=5+5)
	ScaleCRLargeDown-8         355ms ± 4%     350ms ± 2%     ~     (p=0.690 n=5+5)
	ScaleNNDown-8              134µs ± 2%     126µs ± 1%   -5.68%  (p=0.008 n=5+5)
	ScaleABDown-8              261µs ± 3%     256µs ± 1%   -1.92%  (p=0.016 n=5+5)
	ScaleBLDown-8             2.42ms ± 3%    2.44ms ± 8%     ~     (p=0.841 n=5+5)
	ScaleCRDown-8             4.36ms ± 1%    4.85ms ± 4%  +11.22%  (p=0.008 n=5+5)
	ScaleNNUp-8               6.27ms ± 2%    6.72ms ± 3%   +7.20%  (p=0.008 n=5+5)
	ScaleABUp-8               12.8ms ± 1%    13.8ms ± 2%   +7.26%  (p=0.008 n=5+5)
	ScaleBLUp-8               17.5ms ± 7%    17.4ms ± 2%     ~     (p=1.000 n=5+5)
	ScaleCRUp-8               23.2ms ± 2%    23.1ms ± 4%     ~     (p=0.690 n=5+5)
	ScaleNNSrcRGBA-8           419µs ± 1%     421µs ± 3%     ~     (p=0.690 n=5+5)
	ScaleNNSrcUnif-8          3.35µs ± 3%    3.35µs ± 2%     ~     (p=1.000 n=5+5)
	ScaleNNOverRGBA-8          470µs ± 1%     479µs ± 5%     ~     (p=0.548 n=5+5)
	ScaleNNOverUnif-8          102µs ± 2%     102µs ± 1%     ~     (p=0.222 n=5+5)
	TformNNSrcRGBA-8           215µs ± 1%     213µs ± 1%     ~     (p=0.222 n=5+5)
	TformNNSrcUnif-8          84.2µs ± 1%    86.6µs ± 2%   +2.82%  (p=0.016 n=5+5)
	TformNNOverRGBA-8          351µs ± 5%     359µs ± 0%     ~     (p=0.151 n=5+5)
	TformNNOverUnif-8          101µs ± 1%     104µs ± 1%   +3.47%  (p=0.008 n=5+5)
	ScaleABSrcGray-8           399µs ± 2%     400µs ± 2%     ~     (p=0.690 n=5+5)
	ScaleABSrcNRGBA-8          795µs ± 1%     809µs ± 4%     ~     (p=0.095 n=5+5)
	ScaleABSrcRGBA-8           807µs ± 1%     807µs ± 2%     ~     (p=1.000 n=5+5)
	ScaleABSrcYCbCr-8         1.50ms ± 1%    1.48ms ± 0%   -0.76%  (p=0.032 n=5+5)
	ScaleABOverGray-8          396µs ± 0%     395µs ± 1%     ~     (p=0.421 n=5+5)
	ScaleABOverNRGBA-8         886µs ± 1%     885µs ± 1%     ~     (p=0.556 n=4+5)
	ScaleABOverRGBA-8          893µs ± 1%     895µs ± 1%     ~     (p=0.310 n=5+5)
	ScaleABOverYCbCr-8        1.49ms ± 1%    1.49ms ± 1%     ~     (p=0.548 n=5+5)
	TformABSrcGray-8           359µs ± 1%     364µs ± 3%     ~     (p=0.421 n=5+5)
	TformABSrcNRGBA-8          618µs ± 1%     660µs ± 3%   +6.81%  (p=0.008 n=5+5)
	TformABSrcRGBA-8           614µs ± 1%     638µs ± 5%   +3.94%  (p=0.008 n=5+5)
	TformABSrcYCbCr-8          903µs ± 1%     913µs ± 2%     ~     (p=0.056 n=5+5)
	TformABOverGray-8          362µs ± 3%     358µs ± 1%     ~     (p=0.421 n=5+5)
	TformABOverNRGBA-8         691µs ± 1%     690µs ± 1%     ~     (p=0.841 n=5+5)
	TformABOverRGBA-8          671µs ± 1%     673µs ± 1%     ~     (p=0.690 n=5+5)
	TformABOverYCbCr-8         904µs ± 1%     906µs ± 0%     ~     (p=0.190 n=5+4)
	ScaleCRSrcGray-8          9.24ms ± 1%    9.16ms ± 1%     ~     (p=0.222 n=5+5)
	ScaleCRSrcNRGBA-8         21.9ms ± 2%    21.7ms ± 1%     ~     (p=0.222 n=5+5)
	ScaleCRSrcRGBA-8          22.5ms ± 8%    21.8ms ± 1%     ~     (p=1.000 n=5+5)
	ScaleCRSrcYCbCr-8         43.6ms ± 1%    43.9ms ± 1%     ~     (p=0.222 n=5+5)
	ScaleCROverGray-8         9.24ms ± 0%    9.35ms ± 6%     ~     (p=0.690 n=5+5)
	ScaleCROverNRGBA-8        21.9ms ± 1%    21.8ms ± 1%     ~     (p=0.548 n=5+5)
	ScaleCROverRGBA-8         21.8ms ± 0%    22.0ms ± 1%   +0.94%  (p=0.008 n=5+5)
	ScaleCROverYCbCr-8        43.5ms ± 1%    44.1ms ± 1%   +1.53%  (p=0.008 n=5+5)
	TformCRSrcGray-8          3.16ms ± 4%    3.06ms ± 1%     ~     (p=0.056 n=5+5)
	TformCRSrcNRGBA-8         4.21ms ± 1%    4.20ms ± 1%     ~     (p=0.841 n=5+5)
	TformCRSrcRGBA-8          4.29ms ± 1%    4.29ms ± 1%     ~     (p=0.841 n=5+5)
	TformCRSrcYCbCr-8         5.55ms ± 1%    5.58ms ± 0%   +0.67%  (p=0.032 n=5+4)
	TformCROverGray-8         3.08ms ± 1%    3.07ms ± 2%     ~     (p=0.421 n=5+5)
	TformCROverNRGBA-8        4.40ms ± 1%    4.39ms ± 0%     ~     (p=0.841 n=5+5)
	TformCROverRGBA-8         4.50ms ± 5%    4.44ms ± 0%     ~     (p=0.730 n=5+4)
	TformCROverYCbCr-8        5.57ms ± 0%    5.61ms ± 1%     ~     (p=0.095 n=5+5)

Change-Id: I981861c28e103b68275a82e051d2999a8e714502
Reviewed-on: https://go-review.googlesource.com/c/148575
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-09 23:22:46 +00:00
bmp bmp: update comment about decoding 32 bpp images 2018-10-23 23:21:08 +00:00
cmd/webp-manual-test webp: fix tests for webp/nycbcra deprecation. 2016-04-02 01:02:22 +00:00
colornames colornames: update SVG 1.1 spec URL 2018-11-08 20:49:13 +00:00
draw draw: re-enable the image.Rectangle DstMask fast path 2018-11-09 23:22:46 +00:00
example/font example/font: use an "example" build tag instead of "ignore". 2016-04-12 11:14:18 +00:00
font font/sfnt: rename ExampleRasterizeGlyph to Example_rasterizeGlyph 2018-11-09 00:22:02 +00:00
math math/fixed: add some Point and Rectangle methods. 2017-01-06 00:18:22 +00:00
riff riff: fix some short chunk data bugs. 2016-07-07 05:37:58 +00:00
testdata image/bmp: support v4 and v5 info header versions 2018-10-23 22:58:01 +00:00
tiff all: fix typos 2018-10-30 00:21:51 +00:00
vector vector: remove Go 1.8 support 2018-11-08 20:57:45 +00:00
vp8 all: fix typos 2018-10-30 00:21:51 +00:00
vp8l vp8l: don't ignore I/O errors when reading LZ77 parameters. 2015-05-11 04:53:56 +00:00
webp webp: remove Go 1.8 support 2018-11-08 21:37:21 +00:00
.gitattributes image: copying .gitattributes to all subrepositories 2014-12-23 11:05:35 +00:00
.gitignore convert .hgignore to .gitignore. 2014-12-08 10:42:30 +11:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg image: add codereview.cfg 2015-03-18 17:04:05 +00:00
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests 2018-03-14 18:02:48 +00:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:31 +11:00
PATENTS go.image: add PATENTS file to the subrepo. 2012-04-16 11:25:02 +10:00
README.md README: fix go get instructions 2018-06-01 11:54:56 +00:00

Go Images

This repository holds supplementary Go image libraries.

Download/Install

The easiest way to install is to run go get -u golang.org/x/image/.... You can also manually git clone the repository to $GOPATH/src/golang.org/x/image.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the image repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/image:" in the subject line, so it is easy to find.