OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkImageGenerator_DEFINED | 8 #ifndef SkImageGenerator_DEFINED |
9 #define SkImageGenerator_DEFINED | 9 #define SkImageGenerator_DEFINED |
10 | 10 |
| 11 #include "SkColor.h" |
11 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
12 #include "SkColor.h" | |
13 | 13 |
14 class SkBitmap; | 14 class SkBitmap; |
15 class SkData; | 15 class SkData; |
16 class SkImageGenerator; | 16 class SkImageGenerator; |
17 | 17 |
18 /** | 18 /** |
19 * Takes ownership of SkImageGenerator. If this method fails for | 19 * Takes ownership of SkImageGenerator. If this method fails for |
20 * whatever reason, it will return false and immediatetely delete | 20 * whatever reason, it will return false and immediatetely delete |
21 * the generator. If it succeeds, it will modify destination | 21 * the generator. If it succeeds, it will modify destination |
22 * bitmap. | 22 * bitmap. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 * If planes or rowBytes is NULL or if any entry in planes is NULL or if an
y entry in rowBytes | 114 * If planes or rowBytes is NULL or if any entry in planes is NULL or if an
y entry in rowBytes |
115 * is 0, this imagegenerator should output the sizes and return true if it
can efficiently | 115 * is 0, this imagegenerator should output the sizes and return true if it
can efficiently |
116 * return YUV planar data. If it cannot, it should return false. Note that
either planes and | 116 * return YUV planar data. If it cannot, it should return false. Note that
either planes and |
117 * rowBytes are both fully defined and non NULL/non 0 or they are both NULL
or have NULL or 0 | 117 * rowBytes are both fully defined and non NULL/non 0 or they are both NULL
or have NULL or 0 |
118 * entries only. Having only partial planes/rowBytes information is not sup
ported. | 118 * entries only. Having only partial planes/rowBytes information is not sup
ported. |
119 * | 119 * |
120 * If all planes and rowBytes entries are non NULL or non 0, then it should
copy the | 120 * If all planes and rowBytes entries are non NULL or non 0, then it should
copy the |
121 * associated YUV data into those planes of memory supplied by the caller.
It should validate | 121 * associated YUV data into those planes of memory supplied by the caller.
It should validate |
122 * that the sizes match what it expected. If the sizes do not match, it sho
uld return false. | 122 * that the sizes match what it expected. If the sizes do not match, it sho
uld return false. |
123 */ | 123 */ |
124 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]); | 124 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| 125 SkYUVColorSpace* colorSpace); |
125 | 126 |
126 protected: | 127 protected: |
127 virtual SkData* onRefEncodedData(); | 128 virtual SkData* onRefEncodedData(); |
128 virtual bool onGetInfo(SkImageInfo* info); | 129 virtual bool onGetInfo(SkImageInfo* info); |
129 virtual bool onGetPixels(const SkImageInfo& info, | 130 virtual bool onGetPixels(const SkImageInfo& info, |
130 void* pixels, size_t rowBytes, | 131 void* pixels, size_t rowBytes, |
131 SkPMColor ctable[], int* ctableCount); | 132 SkPMColor ctable[], int* ctableCount); |
132 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3]); | 133 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3]); |
| 134 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
| 135 SkYUVColorSpace* colorSpace); |
133 }; | 136 }; |
134 | 137 |
135 #endif // SkImageGenerator_DEFINED | 138 #endif // SkImageGenerator_DEFINED |
OLD | NEW |