Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5e381d3a
Commit
5e381d3a
authored
Feb 08, 2012
by
Nigel Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image: delete the image.Repeated type.
R=r CC=golang-dev
https://golang.org/cl/5636045
parent
2f8e5a5f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
116 deletions
+2
-116
go1.html
doc/go1.html
+1
-4
go1.tmpl
doc/go1.tmpl
+1
-4
imagetiled.go
src/cmd/fix/imagetiled.go
+0
-40
imagetiled_test.go
src/cmd/fix/imagetiled_test.go
+0
-41
names.go
src/pkg/image/names.go
+0
-27
No files found.
doc/go1.html
View file @
5e381d3a
...
...
@@ -1115,9 +1115,7 @@ packages.
The old
<code>
image.ColorImage
</code>
type is still in the
<code>
image
</code>
package but has been renamed
<a
href=
"/pkg/image/#Uniform"
><code>
image.Uniform
</code></a>
,
while
<code>
image.Tiled
</code>
has been renamed
<a
href=
"/pkg/image/#Repeated"
><code>
image.Repeated
</code></a>
.
while
<code>
image.Tiled
</code>
has been removed.
</p>
<p>
...
...
@@ -1178,7 +1176,6 @@ This table lists the renamings.
<td
colspan=
"2"
><hr></td>
</tr>
<tr><td>
image.ColorImage
</td>
<td>
image.Uniform
</td></tr>
<tr><td>
image.Tiled
</td>
<td>
image.Repeated
</td></tr>
</table>
<p>
...
...
doc/go1.tmpl
View file @
5e381d3a
...
...
@@ -1018,9 +1018,7 @@ packages.
The old <code>image.ColorImage</code> type is still in the <code>image</code>
package but has been renamed
<a href="/pkg/image/#Uniform"><code>image.Uniform</code></a>,
while <code>image.Tiled</code>
has been renamed
<a href="/pkg/image/#Repeated"><code>image.Repeated</code></a>.
while <code>image.Tiled</code> has been removed.
</p>
<p>
...
...
@@ -1081,7 +1079,6 @@ This table lists the renamings.
<td colspan="2"><hr></td>
</tr>
<tr><td>image.ColorImage</td> <td>image.Uniform</td></tr>
<tr><td>image.Tiled</td> <td>image.Repeated</td></tr>
</table>
<p>
...
...
src/cmd/fix/imagetiled.go
deleted
100644 → 0
View file @
2f8e5a5f
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
main
import
(
"go/ast"
)
func
init
()
{
register
(
imagetiledFix
)
}
var
imagetiledFix
=
fix
{
"imagetiled"
,
"2012-01-10"
,
imagetiled
,
`Rename image.Tiled to image.Repeated.
http://codereview.appspot.com/5530062
`
,
}
func
imagetiled
(
f
*
ast
.
File
)
bool
{
if
!
imports
(
f
,
"image"
)
{
return
false
}
fixed
:=
false
walk
(
f
,
func
(
n
interface
{})
{
s
,
ok
:=
n
.
(
*
ast
.
SelectorExpr
)
if
!
ok
||
!
isTopName
(
s
.
X
,
"image"
)
||
s
.
Sel
.
String
()
!=
"Tiled"
{
return
}
s
.
Sel
=
&
ast
.
Ident
{
Name
:
"Repeated"
}
fixed
=
true
})
return
fixed
}
src/cmd/fix/imagetiled_test.go
deleted
100644 → 0
View file @
2f8e5a5f
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
main
func
init
()
{
addTestCases
(
imagetiledTests
,
imagetiled
)
}
var
imagetiledTests
=
[]
testCase
{
{
Name
:
"imagetiled.0"
,
In
:
`package main
import (
"foo"
"image"
)
var (
_ foo.Tiled
_ image.RGBA
_ image.Tiled
)
`
,
Out
:
`package main
import (
"foo"
"image"
)
var (
_ foo.Tiled
_ image.RGBA
_ image.Repeated
)
`
,
},
}
src/pkg/image/names.go
View file @
5e381d3a
...
...
@@ -50,30 +50,3 @@ func (c *Uniform) Opaque() bool {
func
NewUniform
(
c
color
.
Color
)
*
Uniform
{
return
&
Uniform
{
c
}
}
// Repeated is an Image that is a source Image translated by -Offset and then
// repeated in all four directions to infinity.
//
// Repeated{src, off}.At(x, y) will equal src.At(x+off.X, y+off.Y) for all
// points {x+off.X, y+off.Y} within src's Bounds.
type
Repeated
struct
{
// I is the source image.
I
Image
// Offset is the translation vector from result pixel to source pixel.
Offset
Point
}
func
(
r
*
Repeated
)
ColorModel
()
color
.
Model
{
return
r
.
I
.
ColorModel
()
}
func
(
r
*
Repeated
)
Bounds
()
Rectangle
{
return
Rectangle
{
Point
{
-
1e9
,
-
1e9
},
Point
{
1e9
,
1e9
}}
}
func
(
r
*
Repeated
)
At
(
x
,
y
int
)
color
.
Color
{
p
:=
Point
{
x
,
y
}
.
Add
(
r
.
Offset
)
.
Mod
(
r
.
I
.
Bounds
())
return
r
.
I
.
At
(
p
.
X
,
p
.
Y
)
}
func
NewRepeated
(
i
Image
,
offset
Point
)
*
Repeated
{
return
&
Repeated
{
i
,
offset
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment