OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkImageDecoder_DEFINED | 10 #ifndef SkImageDecoder_DEFINED |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 If the decoder can decompress the image, it calls bitmap.setConfig(), | 212 If the decoder can decompress the image, it calls bitmap.setConfig(), |
213 and then if the Mode is kDecodePixels_Mode, call allocPixelRef(), | 213 and then if the Mode is kDecodePixels_Mode, call allocPixelRef(), |
214 which will allocated a pixelRef. To access the pixel memory, the codec | 214 which will allocated a pixelRef. To access the pixel memory, the codec |
215 needs to call lockPixels/unlockPixels on the | 215 needs to call lockPixels/unlockPixels on the |
216 bitmap. It can then set the pixels with the decompressed image. | 216 bitmap. It can then set the pixels with the decompressed image. |
217 * If the image cannot be decompressed, return false. After the | 217 * If the image cannot be decompressed, return false. After the |
218 * decoding, the function converts the decoded config in bitmap | 218 * decoding, the function converts the decoded config in bitmap |
219 * to pref if possible. Whether a conversion is feasible is | 219 * to pref if possible. Whether a conversion is feasible is |
220 * tested by Bitmap::canCopyTo(pref). | 220 * tested by Bitmap::canCopyTo(pref). |
221 | 221 |
222 note: document use of Allocator, Peeker and Chooser | 222 note: document use of Allocator, Peeker and Chooser |
djsollen
2013/06/26 11:56:45
can you add info here on how they can use the allo
scroggo
2013/06/26 15:35:28
How does the new comment sound? Since bitmap reuse
| |
223 */ | 223 */ |
224 bool decode(SkStream*, SkBitmap* bitmap, SkBitmap::Config pref, Mode, bool r euseBitmap = false); | 224 bool decode(SkStream*, SkBitmap* bitmap, SkBitmap::Config pref, Mode); |
225 bool decode(SkStream* stream, SkBitmap* bitmap, Mode mode, bool reuseBitmap = false) { | 225 bool decode(SkStream* stream, SkBitmap* bitmap, Mode mode) { |
226 return this->decode(stream, bitmap, SkBitmap::kNo_Config, mode, reuseBit map); | 226 return this->decode(stream, bitmap, SkBitmap::kNo_Config, mode); |
227 } | 227 } |
228 | 228 |
229 /** | 229 /** |
230 * Given a stream, build an index for doing tile-based decode. | 230 * Given a stream, build an index for doing tile-based decode. |
231 * The built index will be saved in the decoder, and the image size will | 231 * The built index will be saved in the decoder, and the image size will |
232 * be returned in width and height. | 232 * be returned in width and height. |
233 * | 233 * |
234 * Return true for success or false on failure. | 234 * Return true for success or false on failure. |
235 */ | 235 */ |
236 bool buildTileIndex(SkStream*, int *width, int *height); | 236 bool buildTileIndex(SkStream*, int *width, int *height); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 // not all of these will be available | 491 // not all of these will be available |
492 DECLARE_DECODER_CREATOR(BMPImageDecoder); | 492 DECLARE_DECODER_CREATOR(BMPImageDecoder); |
493 DECLARE_DECODER_CREATOR(GIFImageDecoder); | 493 DECLARE_DECODER_CREATOR(GIFImageDecoder); |
494 DECLARE_DECODER_CREATOR(ICOImageDecoder); | 494 DECLARE_DECODER_CREATOR(ICOImageDecoder); |
495 DECLARE_DECODER_CREATOR(JPEGImageDecoder); | 495 DECLARE_DECODER_CREATOR(JPEGImageDecoder); |
496 DECLARE_DECODER_CREATOR(PNGImageDecoder); | 496 DECLARE_DECODER_CREATOR(PNGImageDecoder); |
497 DECLARE_DECODER_CREATOR(WBMPImageDecoder); | 497 DECLARE_DECODER_CREATOR(WBMPImageDecoder); |
498 DECLARE_DECODER_CREATOR(WEBPImageDecoder); | 498 DECLARE_DECODER_CREATOR(WEBPImageDecoder); |
499 | 499 |
500 #endif | 500 #endif |
OLD | NEW |