OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkCodec_DEFINED | 8 #ifndef SkCodec_DEFINED |
9 #define SkCodec_DEFINED | 9 #define SkCodec_DEFINED |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 * This is the default. It will be used if no Options struct is used. | 121 * This is the default. It will be used if no Options struct is used. |
122 */ | 122 */ |
123 kNo_ZeroInitialized, | 123 kNo_ZeroInitialized, |
124 }; | 124 }; |
125 | 125 |
126 /** | 126 /** |
127 * Additional options to pass to getPixels. | 127 * Additional options to pass to getPixels. |
128 */ | 128 */ |
129 struct Options { | 129 struct Options { |
130 Options() | 130 Options() |
131 : fZeroInitialized(kNo_ZeroInitialized) {} | 131 : fZeroInitialized(kNo_ZeroInitialized) |
| 132 { |
| 133 fSubset.setEmpty(); |
| 134 } |
132 | 135 |
133 ZeroInitialized fZeroInitialized; | 136 ZeroInitialized fZeroInitialized; |
| 137 /** |
| 138 * If not empty, represents a subset of the original image to decode. |
| 139 */ |
| 140 SkIRect fSubset; |
134 }; | 141 }; |
135 | 142 |
136 /** | 143 /** |
137 * Decode into the given pixels, a block of memory of size at | 144 * Decode into the given pixels, a block of memory of size at |
138 * least (info.fHeight - 1) * rowBytes + (info.fWidth * | 145 * least (info.fHeight - 1) * rowBytes + (info.fWidth * |
139 * bytesPerPixel) | 146 * bytesPerPixel) |
140 * | 147 * |
141 * Repeated calls to this function should give the same results, | 148 * Repeated calls to this function should give the same results, |
142 * allowing the PixelRef to be immutable. | 149 * allowing the PixelRef to be immutable. |
143 * | 150 * |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 SkStream* stream() { | 288 SkStream* stream() { |
282 return fStream.get(); | 289 return fStream.get(); |
283 } | 290 } |
284 | 291 |
285 private: | 292 private: |
286 const SkImageInfo fInfo; | 293 const SkImageInfo fInfo; |
287 SkAutoTDelete<SkStream> fStream; | 294 SkAutoTDelete<SkStream> fStream; |
288 bool fNeedsRewind; | 295 bool fNeedsRewind; |
289 }; | 296 }; |
290 #endif // SkCodec_DEFINED | 297 #endif // SkCodec_DEFINED |
OLD | NEW |