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