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

Unified Diff: include/core/SkImageGenerator.h

Issue 863053002: new API for retrieving YUV data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageGenerator.h
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index 2967974c7845cb95cfb6c5b7f2e3b0815fde9f88..d8330a491f42a1991c5ce78caf40413328183be4 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -122,6 +122,26 @@ public:
SkYUVColorSpace* colorSpace);
/**
+ * If this generator supports returning planar YUV data, return true, and return
+ * the logicalSizes (if not NULL) and the optimalAllocationSizes (if not NULL), where each
+ * array represents [0]=Y, [1]=U, [2]=V
+ *
+ * The optimalAllocationSizes may be the same as the logicalSizes, but they may also be larger
+ * if that will aid the generator (for performance).
+ *
+ * If this returns false, the value of the (optional) sizes parameters is undefined.
sugoi1 2015/01/22 15:01:37 What if the decoder failed completely and the logi
reed1 2015/01/22 16:01:36 To get to the stage of being an imagegenerator at
scroggo 2015/01/27 18:35:49 In general, I would suggest that if it returns fal
reed1 2015/01/27 18:44:03 Agreed, will make that change.
+ */
+ bool queryYUV8(SkISize logicalSizes[3], SkISize optimalAllocationSizes[3]);
+
+ /**
+ * If this generator supports returning planar YUV data, and can fulfill the requested
+ * sizes for each plane, return true and write the YUV data into the planes.
+ *
+ * If colorSpace is not NULL, return the corresponding colorSpace for the YUV data.
+ */
+ bool getYUV8(const SkISize allocationSizes[3], void* planes[3], SkYUVColorSpace* colorSpace);
+
+ /**
* If the default image decoder system can interpret the specified (encoded) data, then
* this returns a new ImageGenerator for it. Otherwise this returns NULL. Either way
* the caller is still responsible for managing their ownership of the data.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698