OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkAndroidCodec_DEFINED | 8 #ifndef SkAndroidCodec_DEFINED |
9 #define SkAndroidCodec_DEFINED | 9 #define SkAndroidCodec_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 | 47 |
48 const SkImageInfo& getInfo() const { return fInfo; } | 48 const SkImageInfo& getInfo() const { return fInfo; } |
49 | 49 |
50 /** | 50 /** |
51 * Format of the encoded data. | 51 * Format of the encoded data. |
52 */ | 52 */ |
53 SkEncodedFormat getEncodedFormat() const { return this->onGetEncodedFormat()
; } | 53 SkEncodedFormat getEncodedFormat() const { return this->onGetEncodedFormat()
; } |
54 | 54 |
55 /** | 55 /** |
| 56 * @param requestedColorType Color type requested by the client |
| 57 * |
| 58 * If it is possible to decode to requestedColorType, this returns |
| 59 * requestedColorType. Otherwise, this returns whichever color type |
| 60 * is suggested by the codec as the best match for the encoded data. |
| 61 */ |
| 62 SkColorType computeOutputColorType(SkColorType requestedColorType); |
| 63 |
| 64 /** |
| 65 * @param requestedUnpremul Indicates if the client requested |
| 66 * unpremultiplied output |
| 67 * |
| 68 * Returns the appropriate alpha type to decode to. If the image |
| 69 * has alpha, the value of requestedUnpremul will be honored. |
| 70 */ |
| 71 SkAlphaType computeOutputAlphaType(bool requestedUnpremul); |
| 72 |
| 73 /** |
56 * Returns the dimensions of the scaled output image, for an input | 74 * Returns the dimensions of the scaled output image, for an input |
57 * sampleSize. | 75 * sampleSize. |
58 * | 76 * |
59 * When the sample size divides evenly into the original dimensions, the | 77 * When the sample size divides evenly into the original dimensions, the |
60 * scaled output dimensions will simply be equal to the original | 78 * scaled output dimensions will simply be equal to the original |
61 * dimensions divided by the sample size. | 79 * dimensions divided by the sample size. |
62 * | 80 * |
63 * When the sample size does not divide even into the original | 81 * When the sample size does not divide even into the original |
64 * dimensions, the codec may round up or down, depending on what is most | 82 * dimensions, the codec may round up or down, depending on what is most |
65 * efficient to decode. | 83 * efficient to decode. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi
xels, | 239 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi
xels, |
222 size_t rowBytes, const AndroidOptions& options) = 0; | 240 size_t rowBytes, const AndroidOptions& options) = 0; |
223 | 241 |
224 private: | 242 private: |
225 | 243 |
226 // This will always be a reference to the info that is contained by the | 244 // This will always be a reference to the info that is contained by the |
227 // embedded SkCodec. | 245 // embedded SkCodec. |
228 const SkImageInfo& fInfo; | 246 const SkImageInfo& fInfo; |
229 }; | 247 }; |
230 #endif // SkAndroidCodec_DEFINED | 248 #endif // SkAndroidCodec_DEFINED |
OLD | NEW |