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 15 matching lines...) Expand all Loading... | |
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 |
97 /* | 98 /* |
99 * Create the swizzler based on the encoded format | |
100 */ | |
101 Result initializeSwizzler(const SkImageInfo& requestedInfo, void* dst, size_ t rowBytes, | |
102 const Options&, SkPMColor*, int* ctableCount); | |
103 | |
104 /* | |
98 * Handles rewinding the input stream if it is necessary | 105 * Handles rewinding the input stream if it is necessary |
99 */ | 106 */ |
100 bool handleRewind(); | 107 bool handleRewind(); |
101 | 108 |
102 /* | 109 /* |
103 * Checks if the conversion between the input image and the requested output | 110 * Checks if the conversion between the input image and the requested output |
104 * image has been implemented | 111 * image has been implemented |
105 * Sets the output color space | 112 * Sets the output color space |
106 */ | 113 */ |
107 bool setOutputColorSpace(const SkImageInfo& dst); | 114 bool setOutputColorSpace(const SkImageInfo& dst); |
108 | 115 |
109 /* | 116 /* |
110 * Checks if we can scale to the requested dimensions and scales the dimensi ons | 117 * Checks if we can natively scale to the requested dimensions and natively scales the |
111 * if possible | 118 * dimensions if possible |
112 */ | 119 */ |
113 bool scaleToDimensions(uint32_t width, uint32_t height); | 120 bool nativelyScaleToDimensions(uint32_t width, uint32_t height); |
114 | |
115 /* | |
116 * Create the swizzler based on the encoded format | |
117 */ | |
118 void initializeSwizzler(const SkImageInfo& dstInfo, void* dst, size_t dstRow Bytes, | |
119 const Options& options); | |
120 | 121 |
121 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 122 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
122 | 123 int fPartialDenom; |
scroggo
2015/08/05 15:36:01
It looks like these are no longer used?
| |
124 int fPartialNum; | |
123 friend class SkJpegScanlineDecoder; | 125 friend class SkJpegScanlineDecoder; |
124 | 126 |
125 typedef SkCodec INHERITED; | 127 typedef SkCodec INHERITED; |
126 }; | 128 }; |
127 | 129 |
128 #endif | 130 #endif |
OLD | NEW |