diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-15 13:04:45 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-15 13:04:45 +0000 |
commit | b3ade9d1b0a63f8f0dc3bee5785e930c8e84311d (patch) | |
tree | eb35c1c777a537e2d550d6855c3a714867e25ddb /include/images | |
parent | 5119bdb952025a30f115b9c6a187173956e55097 (diff) |
add optional Format* parameter to decoder helper functions.
git-svn-id: http://skia.googlecode.com/svn/trunk@215 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/images')
-rw-r--r-- | include/images/SkImageDecoder.h | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/include/images/SkImageDecoder.h b/include/images/SkImageDecoder.h index d2b23a1216..d293cec774 100644 --- a/include/images/SkImageDecoder.h +++ b/include/images/SkImageDecoder.h @@ -160,12 +160,16 @@ public: there is a conflict (e.g. the image has per-pixel alpha and the bitmap's config does not support that), in which case the decoder will choose a closest match configuration. + + @param format On success, if format is non-null, it is set to the format + of the decoded file. On failure it is ignored. */ static bool DecodeFile(const char file[], SkBitmap* bitmap, - SkBitmap::Config prefConfig, Mode); - static bool DecodeFile(const char file[], SkBitmap* bitmap) - { - return DecodeFile(file, bitmap, SkBitmap::kNo_Config, kDecodePixels_Mode); + SkBitmap::Config prefConfig, Mode, + Format* format); + static bool DecodeFile(const char file[], SkBitmap* bitmap) { + return DecodeFile(file, bitmap, SkBitmap::kNo_Config, + kDecodePixels_Mode, NULL); } /** Decode the image stored in the specified memory buffer, and store the result in bitmap. Return true for success or false on failure. @@ -176,13 +180,16 @@ public: there is a conflict (e.g. the image has per-pixel alpha and the bitmap's config does not support that), in which case the decoder will choose a closest match configuration. - */ + + @param format On success, if format is non-null, it is set to the format + of the decoded buffer. On failure it is ignored. + */ static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap, - SkBitmap::Config prefConfig, Mode); - static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap) - { + SkBitmap::Config prefConfig, Mode, + Format* format); + static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap){ return DecodeMemory(buffer, size, bitmap, SkBitmap::kNo_Config, - kDecodePixels_Mode); + kDecodePixels_Mode, NULL); } /** Decode the image stored in the specified SkStream, and store the result in bitmap. Return true for success or false on failure. @@ -193,13 +200,16 @@ public: format, unless there is a conflict (e.g. the image has per-pixel alpha and the bitmap's config does not support that), in which case the decoder will choose a closest match configuration. - */ + + @param format On success, if format is non-null, it is set to the format + of the decoded stream. On failure it is ignored. + */ static bool DecodeStream(SkStream* stream, SkBitmap* bitmap, - SkBitmap::Config prefConfig, Mode); - static bool DecodeStream(SkStream* stream, SkBitmap* bitmap) - { + SkBitmap::Config prefConfig, Mode, + Format* format); + static bool DecodeStream(SkStream* stream, SkBitmap* bitmap) { return DecodeStream(stream, bitmap, SkBitmap::kNo_Config, - kDecodePixels_Mode); + kDecodePixels_Mode, NULL); } /** Return the default config for the running device. |