aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar sugoi <sugoi@chromium.org>2014-10-16 13:10:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-16 13:10:57 -0700
commitb227e37eae36ccf630c4baef00b1354d42b40fd1 (patch)
treed5c343b2d301d8b2fa72d7ed13b6fad8c6d798fb /include
parent62372bcc6abe3537dac98dd9b9172cf3b85afa2b (diff)
JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia BUG=skia:3005, skia:1674, skia:3029 Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f Review URL: https://codereview.chromium.org/399683007
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImageDecoder.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index 5910d33a99..94831762de 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -47,6 +47,15 @@ public:
*/
virtual Format getFormat() const;
+ /** If planes or rowBytes is NULL, decodes the header and computes componentSizes
+ for memory allocation.
+ Otherwise, decodes the YUV planes into the provided image planes and
+ updates componentSizes to the final image size.
+ Returns whether the decoding was successful.
+ */
+ bool decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], void* planes[3],
+ size_t rowBytes[3], SkYUVColorSpace*);
+
/** Return the format of the SkStreamRewindable or kUnknown_Format if it cannot be determined.
Rewinds the stream before returning.
*/
@@ -339,6 +348,17 @@ protected:
return false;
}
+ /** If planes or rowBytes is NULL, decodes the header and computes componentSizes
+ for memory allocation.
+ Otherwise, decodes the YUV planes into the provided image planes and
+ updates componentSizes to the final image size.
+ Returns whether the decoding was successful.
+ */
+ virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], void* planes[3],
+ size_t rowBytes[3], SkYUVColorSpace*) {
+ 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.