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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SkPMColor*, int*) override; | 53 SkPMColor*, int*) override; |
54 | 54 |
55 SkEncodedFormat onGetEncodedFormat() const override { | 55 SkEncodedFormat onGetEncodedFormat() const override { |
56 return kJPEG_SkEncodedFormat; | 56 return kJPEG_SkEncodedFormat; |
57 } | 57 } |
58 | 58 |
59 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op
tions& options, | 59 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op
tions& options, |
60 SkPMColor ctable[], int* ctableCount) override; | 60 SkPMColor ctable[], int* ctableCount) override; |
61 | 61 |
62 private: | 62 private: |
| 63 SkAutoTDelete<SkSwizzler> fSwizzler; |
63 | 64 |
64 /* | 65 /* |
65 * Read enough of the stream to initialize the SkJpegCodec. | 66 * Read enough of the stream to initialize the SkJpegCodec. |
66 * Returns a bool representing success or failure. | 67 * Returns a bool representing success or failure. |
67 * | 68 * |
68 * @param codecOut | 69 * @param codecOut |
69 * If this returns true, and codecOut was not NULL, | 70 * If this returns true, and codecOut was not NULL, |
70 * codecOut will be set to a new SkJpegCodec. | 71 * codecOut will be set to a new SkJpegCodec. |
71 * | 72 * |
72 * @param decoderMgrOut | 73 * @param decoderMgrOut |
(...skipping 14 matching lines...) Expand all Loading... |
87 * Creates an instance of the decoder | 88 * Creates an instance of the decoder |
88 * Called only by NewFromStream | 89 * Called only by NewFromStream |
89 * | 90 * |
90 * @param srcInfo contains the source width and height | 91 * @param srcInfo contains the source width and height |
91 * @param stream the encoded image data | 92 * @param stream the encoded image data |
92 * @param decoderMgr holds decompress struct, src manager, and error manager | 93 * @param decoderMgr holds decompress struct, src manager, and error manager |
93 * takes ownership | 94 * takes ownership |
94 */ | 95 */ |
95 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); | 96 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); |
96 | 97 |
| 98 // Helper to set up swizzler. |
| 99 Result initializeSwizzler(const SkImageInfo& requestedInfo, void* dst, |
| 100 size_t rowBytes, const Options&, SkPMColor*, int*
ctableCount); |
| 101 |
97 /* | 102 /* |
98 * Handles rewinding the input stream if it is necessary | 103 * Handles rewinding the input stream if it is necessary |
99 */ | 104 */ |
100 bool handleRewind(); | 105 bool handleRewind(); |
101 | 106 |
102 /* | 107 /* |
103 * Checks if the conversion between the input image and the requested output | 108 * Checks if the conversion between the input image and the requested output |
104 * image has been implemented | 109 * image has been implemented |
105 * Sets the output color space | 110 * Sets the output color space |
106 */ | 111 */ |
(...skipping 12 matching lines...) Expand all Loading... |
119 const Options& options); | 124 const Options& options); |
120 | 125 |
121 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 126 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
122 | 127 |
123 friend class SkJpegScanlineDecoder; | 128 friend class SkJpegScanlineDecoder; |
124 | 129 |
125 typedef SkCodec INHERITED; | 130 typedef SkCodec INHERITED; |
126 }; | 131 }; |
127 | 132 |
128 #endif | 133 #endif |
OLD | NEW |