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 * @return If it is possible to decode to requestedColorType, this returns | |
59 * requestedColorType. Otherwise, this returns kN32_SkColorType. | |
60 */ | |
61 SkColorType fixRequestedColorType(SkColorType requestedColorType); | |
djsollen
2015/12/10 21:06:45
this seems like an odd name to me. something like
msarett
2015/12/10 22:41:55
Changing to computeOutput*Type()
| |
62 | |
63 /** | |
64 * @param requestedUnpremul Indicates if the client requested | |
65 * unpremultiplied output | |
66 * | |
67 * @return Returns the appropriate alpha type to decode to. If the image | |
68 * has alpha, the value of requestedUnpremul will be honored. | |
69 */ | |
70 SkAlphaType fixRequestedAlphaType(bool requestedUnpremul); | |
71 | |
72 /** | |
56 * Returns the dimensions of the scaled output image, for an input | 73 * Returns the dimensions of the scaled output image, for an input |
57 * sampleSize. | 74 * sampleSize. |
58 * | 75 * |
59 * When the sample size divides evenly into the original dimensions, the | 76 * When the sample size divides evenly into the original dimensions, the |
60 * scaled output dimensions will simply be equal to the original | 77 * scaled output dimensions will simply be equal to the original |
61 * dimensions divided by the sample size. | 78 * dimensions divided by the sample size. |
62 * | 79 * |
63 * When the sample size does not divide even into the original | 80 * 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 | 81 * dimensions, the codec may round up or down, depending on what is most |
65 * efficient to decode. | 82 * 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, | 238 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi xels, |
222 size_t rowBytes, const AndroidOptions& options) = 0; | 239 size_t rowBytes, const AndroidOptions& options) = 0; |
223 | 240 |
224 private: | 241 private: |
225 | 242 |
226 // This will always be a reference to the info that is contained by the | 243 // This will always be a reference to the info that is contained by the |
227 // embedded SkCodec. | 244 // embedded SkCodec. |
228 const SkImageInfo& fInfo; | 245 const SkImageInfo& fInfo; |
229 }; | 246 }; |
230 #endif // SkAndroidCodec_DEFINED | 247 #endif // SkAndroidCodec_DEFINED |
OLD | NEW |