Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: tools/picture_utils.h

Issue 1901113002: Move DM png code to picture_utils, for use by other tools. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to picture_utils. Better fit, fewer dependencies when adding to skiaserve Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | tools/picture_utils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/picture_utils.h
diff --git a/tools/picture_utils.h b/tools/picture_utils.h
index 1373020a5b294db7851edd02fb91c9cf928bbeac..49a2c821a46087974505b3470bcd7d5898f201ec 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
« no previous file with comments | « gyp/tools.gyp ('k') | tools/picture_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698