Chromium Code Reviews| Index: include/core/SkPixelRef.h |
| diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h |
| index afab7fad9e04e746fa289b6d42e58b73fb277900..8801badd33c238f90172f58f47c6712ec56aeb65 100644 |
| --- a/include/core/SkPixelRef.h |
| +++ b/include/core/SkPixelRef.h |
| @@ -220,6 +220,14 @@ public: |
| */ |
| virtual GrTexture* getTexture() { return NULL; } |
| + enum YUVColorSpace { |
|
rileya (GONE FROM CHROMIUM)
2014/09/11 06:59:30
This would probably be better off somewhere else,
|
| + /** Standard JPEG color space. */ |
| + kJPEG_YUVColorSpace, |
| + /** SDTV standard Rec. 601 color space. Uses "studio swing" [16, 235] color |
| + range. See http://en.wikipedia.org/wiki/Rec._601 for details. */ |
| + kRec601_YUVColorSpace |
| + }; |
| + |
| /** |
| * If any planes or rowBytes is NULL, this should output the sizes and return true |
| * if it can efficiently return YUV planar data. If it cannot, it should return false. |
| @@ -227,9 +235,13 @@ public: |
| * If all planes and rowBytes are not NULL, then it should copy the associated Y,U,V data |
| * into those planes of memory supplied by the caller. It should validate that the sizes |
| * match what it expected. If the sizes do not match, it should return false. |
| + * |
| + * If colorSpace is not NULL, the YUV color space of the data should be stored in the address |
| + * it points at. |
| */ |
| - bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]) { |
| - return this->onGetYUV8Planes(sizes, planes, rowBytes); |
| + bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| + YUVColorSpace* colorSpace) { |
| + return this->onGetYUV8Planes(sizes, planes, rowBytes, colorSpace); |
| } |
| bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); |
| @@ -319,7 +331,8 @@ protected: |
| virtual SkData* onRefEncodedData(); |
| // default impl returns false. |
| - virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]); |
| + virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| + YUVColorSpace* colorSpace); |
| /** |
| * Returns the size (in bytes) of the internally allocated memory. |