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

Unified Diff: include/core/SkImageDecoder.h

Issue 399683007: JPEG YUV Decoding (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageDecoder.h
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index b258afedce184e79f3907c7cf8f29a6318c068ba..cf506e7ef191a2ec3b92a87e3b569d095d6ec768 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -46,6 +46,19 @@ public:
*/
virtual Format getFormat() const;
+
+ /** Returns the sizes of each component of the image
+ */
+ virtual bool getComponentSizes(SkStream* stream, SkISize sizes[3]) {
+ return this->onGetComponentSizes(stream, sizes);
+ }
+
+ /* Assigns buffers for YUV decoding
+ */
+ void setYUVBuffers(void* yuv[3], size_t rowBytes[3]) {
+ this->onSetYUVBuffers(yuv, rowBytes);
+ }
+
/** Return the format of the SkStreamRewindable or kUnknown_Format if it cannot be determined.
Rewinds the stream before returning.
*/
@@ -384,6 +397,16 @@ protected:
return false;
}
+ /* If the decoder wants to support YUV based decoding, this method must be overridden.
+ */
+ virtual void onSetYUVBuffers(void* yuv[3], size_t rowBytes[3]) {}
scroggo 2014/07/25 20:48:34 Why not create a new entry point? Right now the cl
+
+ /** Returns the sizes of each component of the image
+ */
+ virtual bool onGetComponentSizes(SkStream*, SkISize sizes[3]) {
+ return false;
+ }
+
/*
* Crop a rectangle from the src Bitmap to the dest Bitmap. src and dst are
* both sampled by sampleSize from an original Bitmap.
« no previous file with comments | « no previous file | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698