| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 kNo_ZeroInitialized, | 142 kNo_ZeroInitialized, |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 /** | 145 /** |
| 146 * Additional options to pass to getPixels. | 146 * Additional options to pass to getPixels. |
| 147 */ | 147 */ |
| 148 struct Options { | 148 struct Options { |
| 149 Options() | 149 Options() |
| 150 : fZeroInitialized(kNo_ZeroInitialized) | 150 : fZeroInitialized(kNo_ZeroInitialized) |
| 151 , fSubset(NULL) | 151 , fSubset(NULL) |
| 152 , fSampleX(1) |
| 152 {} | 153 {} |
| 153 | 154 |
| 154 ZeroInitialized fZeroInitialized; | 155 ZeroInitialized fZeroInitialized; |
| 155 /** | 156 /** |
| 156 * If not NULL, represents a subset of the original image to decode. | 157 * If not NULL, represents a subset of the original image to decode. |
| 157 * | 158 * |
| 158 * Must be within the bounds returned by getInfo(). | 159 * Must be within the bounds returned by getInfo(). |
| 159 * | 160 * |
| 160 * If the EncodedFormat is kWEBP_SkEncodedFormat (the only one which | 161 * If the EncodedFormat is kWEBP_SkEncodedFormat (the only one which |
| 161 * currently supports subsets), the top and left values must be even. | 162 * currently supports subsets), the top and left values must be even. |
| 162 */ | 163 */ |
| 163 SkIRect* fSubset; | 164 SkIRect* fSubset; |
| 165 /** |
| 166 * Sample size in the x direction |
| 167 */ |
| 168 int fSampleX; |
| 164 }; | 169 }; |
| 165 | 170 |
| 166 /** | 171 /** |
| 167 * Decode into the given pixels, a block of memory of size at | 172 * Decode into the given pixels, a block of memory of size at |
| 168 * least (info.fHeight - 1) * rowBytes + (info.fWidth * | 173 * least (info.fHeight - 1) * rowBytes + (info.fWidth * |
| 169 * bytesPerPixel) | 174 * bytesPerPixel) |
| 170 * | 175 * |
| 171 * Repeated calls to this function should give the same results, | 176 * Repeated calls to this function should give the same results, |
| 172 * allowing the PixelRef to be immutable. | 177 * allowing the PixelRef to be immutable. |
| 173 * | 178 * |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 SkStream* stream() { | 321 SkStream* stream() { |
| 317 return fStream.get(); | 322 return fStream.get(); |
| 318 } | 323 } |
| 319 | 324 |
| 320 private: | 325 private: |
| 321 const SkImageInfo fInfo; | 326 const SkImageInfo fInfo; |
| 322 SkAutoTDelete<SkStream> fStream; | 327 SkAutoTDelete<SkStream> fStream; |
| 323 bool fNeedsRewind; | 328 bool fNeedsRewind; |
| 324 }; | 329 }; |
| 325 #endif // SkCodec_DEFINED | 330 #endif // SkCodec_DEFINED |
| OLD | NEW |