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 SkJpegCodec_DEFINED | 8 #ifndef SkJpegCodec_DEFINED |
9 #define SkJpegCodec_DEFINED | 9 #define SkJpegCodec_DEFINED |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 Result onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) overr
ide; | 51 Result onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) overr
ide; |
52 | 52 |
53 SkEncodedFormat onGetEncodedFormat() const override { | 53 SkEncodedFormat onGetEncodedFormat() const override { |
54 return kJPEG_SkEncodedFormat; | 54 return kJPEG_SkEncodedFormat; |
55 } | 55 } |
56 | 56 |
57 bool onRewind() override; | 57 bool onRewind() override; |
58 | 58 |
59 bool onDimensionsSupported(const SkISize&) override; | 59 bool onDimensionsSupported(const SkISize&) override; |
60 | 60 |
| 61 sk_sp<SkData> getICCData() const override { return fICCData; } |
| 62 |
61 private: | 63 private: |
62 | 64 |
63 /* | 65 /* |
64 * Read enough of the stream to initialize the SkJpegCodec. | 66 * Read enough of the stream to initialize the SkJpegCodec. |
65 * Returns a bool representing success or failure. | 67 * Returns a bool representing success or failure. |
66 * | 68 * |
67 * @param codecOut | 69 * @param codecOut |
68 * If this returns true, and codecOut was not nullptr, | 70 * If this returns true, and codecOut was not nullptr, |
69 * codecOut will be set to a new SkJpegCodec. | 71 * codecOut will be set to a new SkJpegCodec. |
70 * | 72 * |
(...skipping 14 matching lines...) Expand all Loading... |
85 /* | 87 /* |
86 * Creates an instance of the decoder | 88 * Creates an instance of the decoder |
87 * Called only by NewFromStream | 89 * Called only by NewFromStream |
88 * | 90 * |
89 * @param info contains properties of the encoded data | 91 * @param info contains properties of the encoded data |
90 * @param stream the encoded image data | 92 * @param stream the encoded image data |
91 * @param decoderMgr holds decompress struct, src manager, and error manager | 93 * @param decoderMgr holds decompress struct, src manager, and error manager |
92 * takes ownership | 94 * takes ownership |
93 */ | 95 */ |
94 SkJpegCodec(int width, int height, const SkEncodedInfo& info, SkStream* stre
am, | 96 SkJpegCodec(int width, int height, const SkEncodedInfo& info, SkStream* stre
am, |
95 JpegDecoderMgr* decoderMgr, sk_sp<SkColorSpace> colorSpace, Origin o
rigin); | 97 JpegDecoderMgr* decoderMgr, sk_sp<SkColorSpace> colorSpace, Origin o
rigin, |
| 98 sk_sp<SkData> iccData); |
96 | 99 |
97 /* | 100 /* |
98 * Checks if the conversion between the input image and the requested output | 101 * Checks if the conversion between the input image and the requested output |
99 * image has been implemented | 102 * image has been implemented |
100 * Sets the output color space | 103 * Sets the output color space |
101 */ | 104 */ |
102 bool setOutputColorSpace(const SkImageInfo& dst); | 105 bool setOutputColorSpace(const SkImageInfo& dst); |
103 | 106 |
104 // scanline decoding | 107 // scanline decoding |
105 void initializeSwizzler(const SkImageInfo& dstInfo, const Options& options); | 108 void initializeSwizzler(const SkImageInfo& dstInfo, const Options& options); |
(...skipping 10 matching lines...) Expand all Loading... |
116 | 119 |
117 // scanline decoding | 120 // scanline decoding |
118 SkAutoTMalloc<uint8_t> fStorage; // Only used if sampling is needed | 121 SkAutoTMalloc<uint8_t> fStorage; // Only used if sampling is needed |
119 uint8_t* fSrcRow; // Only used if sampling is needed | 122 uint8_t* fSrcRow; // Only used if sampling is needed |
120 // libjpeg-turbo provides some subsetting. In the case that libjpeg-turbo | 123 // libjpeg-turbo provides some subsetting. In the case that libjpeg-turbo |
121 // cannot take the exact the subset that we need, we will use the swizzler | 124 // cannot take the exact the subset that we need, we will use the swizzler |
122 // to further subset the output from libjpeg-turbo. | 125 // to further subset the output from libjpeg-turbo. |
123 SkIRect fSwizzlerSubset; | 126 SkIRect fSwizzlerSubset; |
124 SkAutoTDelete<SkSwizzler> fSwizzler; | 127 SkAutoTDelete<SkSwizzler> fSwizzler; |
125 | 128 |
| 129 sk_sp<SkData> fICCData; |
| 130 |
126 typedef SkCodec INHERITED; | 131 typedef SkCodec INHERITED; |
127 }; | 132 }; |
128 | 133 |
129 #endif | 134 #endif |
OLD | NEW |