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

Unified Diff: Source/platform/image-decoders/ImageDecoder.h

Issue 418653002: Allowing YUV data to be retrieved from the JPEG Decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added missing PLATFORM_EXPORT 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
Index: Source/platform/image-decoders/ImageDecoder.h
diff --git a/Source/platform/image-decoders/ImageDecoder.h b/Source/platform/image-decoders/ImageDecoder.h
index 559213011fae93fa14db64b85678ba0c704652f1..b9dfb75fb809a368db8ab1c12316c3e16606da03 100644
--- a/Source/platform/image-decoders/ImageDecoder.h
+++ b/Source/platform/image-decoders/ImageDecoder.h
@@ -49,6 +49,20 @@
namespace blink {
+// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame.
+class PLATFORM_EXPORT ImagePlanes {
+public:
+ ImagePlanes();
+
+ void set(void* planes[3], size_t rowBytes[3]);
+ void* plane(int);
+ size_t rowBytes(int) const;
+
+private:
+ void* m_planes[3];
+ size_t m_rowBytes[3];
+};
+
// ImageDecoder is a base for all format-specific decoders
// (e.g. JPEGImageDecoder). This base manages the ImageFrame cache.
//
@@ -102,6 +116,10 @@ public:
// return the actual decoded size.
virtual IntSize decodedSize() const { return size(); }
+ // Decoders which support YUV decoding can override this to
+ // give potentially different sizes per component.
+ virtual IntSize decodedYUVSize(int component) const { return decodedSize(); }
+
// This will only differ from size() for ICO (where each frame is a
// different icon) or other formats where different frames are different
// sizes. This does NOT differ from size() for GIF or WebP, since
@@ -252,6 +270,10 @@ public:
m_frameBufferCache[0].setMemoryAllocator(allocator);
}
+ virtual bool YUVDecoding() const { return false; }
+ virtual bool decodeToYUV() { return false; }
+ virtual void setImagePlanes(OwnPtr<ImagePlanes>&) { }
+
protected:
// Calculates the most recent frame whose image data may be needed in
// order to decode frame |frameIndex|, based on frame disposal methods
« no previous file with comments | « no previous file | Source/platform/image-decoders/ImageDecoder.cpp » ('j') | Source/platform/image-decoders/ImageDecoder.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698