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 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 * entries only. Having only partial planes/rowBytes information is not sup ported. | 115 * entries only. Having only partial planes/rowBytes information is not sup ported. |
116 * | 116 * |
117 * If all planes and rowBytes entries are non NULL or non 0, then it should copy the | 117 * If all planes and rowBytes entries are non NULL or non 0, then it should copy the |
118 * associated YUV data into those planes of memory supplied by the caller. It should validate | 118 * associated YUV data into those planes of memory supplied by the caller. It should validate |
119 * that the sizes match what it expected. If the sizes do not match, it sho uld return false. | 119 * that the sizes match what it expected. If the sizes do not match, it sho uld return false. |
120 */ | 120 */ |
121 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], | 121 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
122 SkYUVColorSpace* colorSpace); | 122 SkYUVColorSpace* colorSpace); |
123 | 123 |
124 /** | 124 /** |
125 * If this generator supports returning planar YUV data, return true, and r eturn | |
126 * the logicalSizes (if not NULL) and the optimalAllocationSizes (if not NU LL), where each | |
127 * array represents [0]=Y, [1]=U, [2]=V | |
128 * | |
129 * The optimalAllocationSizes may be the same as the logicalSizes, but they may also be larger | |
130 * if that will aid the generator (for performance). | |
131 * | |
132 * If this returns false, the value of the (optional) sizes parameters is u ndefined. | |
sugoi1
2015/01/22 15:01:37
What if the decoder failed completely and the logi
reed1
2015/01/22 16:01:36
To get to the stage of being an imagegenerator at
scroggo
2015/01/27 18:35:49
In general, I would suggest that if it returns fal
reed1
2015/01/27 18:44:03
Agreed, will make that change.
| |
133 */ | |
134 bool queryYUV8(SkISize logicalSizes[3], SkISize optimalAllocationSizes[3]); | |
135 | |
136 /** | |
137 * If this generator supports returning planar YUV data, and can fulfill th e requested | |
138 * sizes for each plane, return true and write the YUV data into the planes . | |
139 * | |
140 * If colorSpace is not NULL, return the corresponding colorSpace for the Y UV data. | |
141 */ | |
142 bool getYUV8(const SkISize allocationSizes[3], void* planes[3], SkYUVColorSp ace* colorSpace); | |
143 | |
144 /** | |
125 * If the default image decoder system can interpret the specified (encoded ) data, then | 145 * If the default image decoder system can interpret the specified (encoded ) data, then |
126 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E ither way | 146 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E ither way |
127 * the caller is still responsible for managing their ownership of the data . | 147 * the caller is still responsible for managing their ownership of the data . |
128 */ | 148 */ |
129 static SkImageGenerator* NewFromData(SkData*); | 149 static SkImageGenerator* NewFromData(SkData*); |
130 | 150 |
131 protected: | 151 protected: |
132 virtual SkData* onRefEncodedData(); | 152 virtual SkData* onRefEncodedData(); |
133 virtual bool onGetInfo(SkImageInfo* info); | 153 virtual bool onGetInfo(SkImageInfo* info); |
134 virtual bool onGetPixels(const SkImageInfo& info, | 154 virtual bool onGetPixels(const SkImageInfo& info, |
135 void* pixels, size_t rowBytes, | 155 void* pixels, size_t rowBytes, |
136 SkPMColor ctable[], int* ctableCount); | 156 SkPMColor ctable[], int* ctableCount); |
137 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); | 157 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); |
138 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3], | 158 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3], |
139 SkYUVColorSpace* colorSpace); | 159 SkYUVColorSpace* colorSpace); |
140 }; | 160 }; |
141 | 161 |
142 #endif // SkImageGenerator_DEFINED | 162 #endif // SkImageGenerator_DEFINED |
OLD | NEW |