diff options
author | 2016-04-19 09:18:11 -0700 | |
---|---|---|
committer | 2016-04-19 09:18:11 -0700 | |
commit | 3c579dcff81dab48a5fb3801d7a34f9c00256ec4 (patch) | |
tree | 455f7706c04b0b1c73d767efd41483fa6a0f721f /tools/picture_utils.h | |
parent | 7e6695416e20a741dae6db5940aa44a3e099a62d (diff) |
Move DM png code to picture_utils, for use by other tools.
Planning to re-use this code in skiaserve in an upcoming change.
TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1901113002
Review URL: https://codereview.chromium.org/1901113002
Diffstat (limited to 'tools/picture_utils.h')
-rw-r--r-- | tools/picture_utils.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/picture_utils.h b/tools/picture_utils.h index 1373020a5b..49a2c821a4 100644 --- a/tools/picture_utils.h +++ b/tools/picture_utils.h @@ -8,7 +8,9 @@ #ifndef picture_utils_DEFINED #define picture_utils_DEFINED -class SkBitmap; +#include "SkBitmap.h" + +class SkData; class SkString; namespace sk_tools { @@ -47,6 +49,12 @@ namespace sk_tools { bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath, const char *subdirOrNull, const SkString& baseName); + // Return raw unpremultiplied RGBA bytes, suitable for storing in a PNG. The output + // colors are assumed to be sRGB values. This is only guaranteed to work for the + // cases that are currently emitted by tools: + // Linear premul 8888, sRGB premul 8888, Linear premul F16 + sk_sp<SkData> encode_bitmap_for_png(SkBitmap bitmap); + } // namespace sk_tools #endif // picture_utils_DEFINED |