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
55badd47
Commit
55badd47
authored
Aug 01, 2010
by
Nigel Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image/png: use image-specific methods for checking opacity.
R=rsc CC=golang-dev, mpl
https://golang.org/cl/1894047
parent
6d37724c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
writer.go
src/pkg/image/png/writer.go
+7
-0
No files found.
src/pkg/image/png/writer.go
View file @
55badd47
...
...
@@ -32,8 +32,15 @@ func writeUint32(b []uint8, u uint32) {
b
[
3
]
=
uint8
(
u
>>
0
)
}
type
opaquer
interface
{
Opaque
()
bool
}
// Returns whether or not the image is fully opaque.
func
opaque
(
m
image
.
Image
)
bool
{
if
o
,
ok
:=
m
.
(
opaquer
);
ok
{
return
o
.
Opaque
()
}
for
y
:=
0
;
y
<
m
.
Height
();
y
++
{
for
x
:=
0
;
x
<
m
.
Width
();
x
++
{
_
,
_
,
_
,
a
:=
m
.
At
(
x
,
y
)
.
RGBA
()
...
...
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