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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 /* | 49 /* |
50 * Initiates the jpeg decode | 50 * Initiates the jpeg decode |
51 */ | 51 */ |
52 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes , const Options&, | 52 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes , const Options&, |
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, | |
60 SkPMColor ctable[], int* ctableCount) override; | |
61 | |
59 private: | 62 private: |
60 | 63 |
61 /* | 64 /* |
62 * Read enough of the stream to initialize the SkJpegCodec. | 65 * Read enough of the stream to initialize the SkJpegCodec. |
63 * Returns a bool representing success or failure. | 66 * Returns a bool representing success or failure. |
64 * | 67 * |
65 * @param codecOut | 68 * @param codecOut |
66 * If this returns true, and codecOut was not NULL, | 69 * If this returns true, and codecOut was not NULL, |
67 * codecOut will be set to a new SkJpegCodec. | 70 * codecOut will be set to a new SkJpegCodec. |
68 * | 71 * |
(...skipping 15 matching lines...) Expand all Loading... | |
84 * Creates an instance of the decoder | 87 * Creates an instance of the decoder |
85 * Called only by NewFromStream | 88 * Called only by NewFromStream |
86 * | 89 * |
87 * @param srcInfo contains the source width and height | 90 * @param srcInfo contains the source width and height |
88 * @param stream the encoded image data | 91 * @param stream the encoded image data |
89 * @param decoderMgr holds decompress struct, src manager, and error manager | 92 * @param decoderMgr holds decompress struct, src manager, and error manager |
90 * takes ownership | 93 * takes ownership |
91 */ | 94 */ |
92 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de coderMgr); | 95 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de coderMgr); |
93 | 96 |
97 /* | |
98 * Handles rewinding the input stream if it is necessary | |
99 */ | |
100 bool handleRewind(); | |
101 | |
102 /* | |
103 * Checks if we can scale to the requested dimensions and performs the scali ng | |
scroggo
2015/04/24 13:14:28
This doesn't actually scale, right? It just sets u
msarett
2015/04/24 15:08:44
Yes this is unclear. I changed the function name
| |
104 */ | |
105 bool handleScaling(const SkImageInfo& dstInfo); | |
106 | |
107 /* | |
108 * Create the swizzler based on the encoded format | |
109 */ | |
110 void initializeSwizzler(const SkImageInfo& dstInfo, void* dst, size_t dstRow Bytes, | |
111 const Options& options); | |
112 | |
94 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 113 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
114 SkAutoTDelete<SkSwizzler> fSwizzler; | |
115 size_t fSrcRowBytes; | |
116 | |
117 friend class SkJpegScanlineDecoder; | |
95 | 118 |
96 typedef SkCodec INHERITED; | 119 typedef SkCodec INHERITED; |
97 }; | 120 }; |
98 | 121 |
99 #endif | 122 #endif |
OLD | NEW |