Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(90)

Side by Side Diff: src/pkg/image/png/reader.go

Issue 1166041: code review 1166041: compress: renamings. (Closed)
Patch Set: code review 1166041: compress: renamings. Created 14 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/crypto/rand/rand_test.go ('k') | src/pkg/image/png/writer.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // The png package implements a PNG image decoder and encoder. 5 // The png package implements a PNG image decoder and encoder.
6 // 6 //
7 // The PNG specification is at http://www.libpng.org/pub/png/spec/1.2/PNG-Conten ts.html 7 // The PNG specification is at http://www.libpng.org/pub/png/spec/1.2/PNG-Conten ts.html
8 package png 8 package png
9 9
10 import ( 10 import (
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 pc := abs(p - int(c)) 199 pc := abs(p - int(c))
200 if pa <= pb && pa <= pc { 200 if pa <= pb && pa <= pc {
201 return a 201 return a
202 } else if pb <= pc { 202 } else if pb <= pc {
203 return b 203 return b
204 } 204 }
205 return c 205 return c
206 } 206 }
207 207
208 func (d *decoder) idatReader(idat io.Reader) os.Error { 208 func (d *decoder) idatReader(idat io.Reader) os.Error {
209 » r, err := zlib.NewInflater(idat) 209 » r, err := zlib.NewReader(idat)
210 if err != nil { 210 if err != nil {
211 return err 211 return err
212 } 212 }
213 defer r.Close() 213 defer r.Close()
214 bpp := 0 // Bytes per pixel. 214 bpp := 0 // Bytes per pixel.
215 maxPalette := uint8(0) 215 maxPalette := uint8(0)
216 var ( 216 var (
217 rgba *image.RGBA 217 rgba *image.RGBA
218 nrgba *image.NRGBA 218 nrgba *image.NRGBA
219 paletted *image.Paletted 219 paletted *image.Paletted
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 err1 := <-d.idatDone 457 err1 := <-d.idatDone
458 if err == nil { 458 if err == nil {
459 err = err1 459 err = err1
460 } 460 }
461 } 461 }
462 if err != nil { 462 if err != nil {
463 return nil, err 463 return nil, err
464 } 464 }
465 return d.image, nil 465 return d.image, nil
466 } 466 }
OLDNEW
« no previous file with comments | « src/pkg/crypto/rand/rand_test.go ('k') | src/pkg/image/png/writer.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b