LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 package jpeg | 5 package jpeg |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "image" | 9 "image" |
10 "image/png" | 10 "image/png" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if !img.Opaque() { | 106 if !img.Opaque() { |
107 panic("expected image to be opaque") | 107 panic("expected image to be opaque") |
108 } | 108 } |
109 b.SetBytes(640 * 480 * 4) | 109 b.SetBytes(640 * 480 * 4) |
110 b.StartTimer() | 110 b.StartTimer() |
111 options := &Options{Quality: 90} | 111 options := &Options{Quality: 90} |
112 for i := 0; i < b.N; i++ { | 112 for i := 0; i < b.N; i++ { |
113 Encode(ioutil.Discard, img, options) | 113 Encode(ioutil.Discard, img, options) |
114 } | 114 } |
115 } | 115 } |
LEFT | RIGHT |