diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-03-04 21:27:36 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-03-04 21:27:36 +0100 |
commit | 04b08da9af0c450d645ab7389d1467308cfc2db8 (patch) | |
tree | db247935fa4f2f94408edc3acd5d0d4f997aa0d8 /doc/articles/image_package.html | |
parent | 917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff) | |
download | golang-04b08da9af0c450d645ab7389d1467308cfc2db8.tar.gz |
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'doc/articles/image_package.html')
-rw-r--r-- | doc/articles/image_package.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/articles/image_package.html b/doc/articles/image_package.html index a9d2f3581..ebe92a1ca 100644 --- a/doc/articles/image_package.html +++ b/doc/articles/image_package.html @@ -45,7 +45,7 @@ classic algebra: dstr, dstg, dstb, dsta := dst.RGBA() srcr, srcg, srcb, srca := src.RGBA() _, _, _, m := mask.RGBA() -const M = 1<<16 - 1 +const M = 1<<16 - 1 // The resultant red value is a blend of dstr and srcr, and ranges in [0, M]. // The calculation for green, blue and alpha is similar. dstr = (dstr*(M-m) + srcr*m) / M @@ -130,7 +130,7 @@ much easier to type. A <code>Rectangle</code> is inclusive at the top-left and exclusive at the bottom-right. For a <code>Point p</code> and a <code>Rectangle r</code>, <code>p.In(r)</code> if and only if -<code>r.Min.X <= p.X && p.X < r.Max.X</code>, and similarly for <code>Y</code>. This is analagous to how +<code>r.Min.X <= p.X && p.X < r.Max.X</code>, and similarly for <code>Y</code>. This is analagous to how a slice <code>s[i0:i1]</code> is inclusive at the low end and exclusive at the high end. (Unlike arrays and slices, a <code>Rectangle</code> often has a non-zero origin.) @@ -193,8 +193,8 @@ way to iterate over an <code>Image</code> m's pixels looks like: <pre> b := m.Bounds() -for y := b.Min.Y; y < b.Max.Y; y++ { - for x := b.Min.X; y < b.Max.X; x++ { +for y := b.Min.Y; y < b.Max.Y; y++ { + for x := b.Min.X; x < b.Max.X; x++ { doStuffWith(m.At(x, y)) } } |