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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 */ | 102 */ |
103 bool setOutputColorSpace(const SkImageInfo& dst); | 103 bool setOutputColorSpace(const SkImageInfo& dst); |
104 | 104 |
105 /* | 105 /* |
106 * Checks if we can natively scale to the requested dimensions and natively
scales the | 106 * Checks if we can natively scale to the requested dimensions and natively
scales the |
107 * dimensions if possible | 107 * dimensions if possible |
108 */ | 108 */ |
109 bool nativelyScaleToDimensions(uint32_t width, uint32_t height); | 109 bool nativelyScaleToDimensions(uint32_t width, uint32_t height); |
110 | 110 |
111 // scanline decoding | 111 // scanline decoding |
112 Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&); | 112 Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&, int s
ubsetLeft, |
| 113 int subsetWidth); |
113 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, | 114 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, |
114 SkPMColor ctable[], int* ctableCount) override; | 115 SkPMColor ctable[], int* ctableCount, int subsetLeft, int subsetWidt
h) override; |
115 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 116 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
116 bool onSkipScanlines(int count) override; | 117 bool onSkipScanlines(int count) override; |
117 | 118 |
118 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 119 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
119 // We will save the state of the decompress struct after reading the header. | 120 // We will save the state of the decompress struct after reading the header. |
120 // This allows us to safely call onGetScaledDimensions() at any time. | 121 // This allows us to safely call onGetScaledDimensions() at any time. |
121 const int fReadyState; | 122 const int fReadyState; |
122 | 123 |
123 // scanline decoding | 124 // scanline decoding |
124 SkAutoMalloc fStorage; // Only used if sampling is needed | 125 SkAutoMalloc fStorage; // Only used if sampling is needed |
125 uint8_t* fSrcRow; // Only used if sampling is needed | 126 uint8_t* fSrcRow; // Only used if sampling is needed |
126 SkAutoTDelete<SkSwizzler> fSwizzler; | 127 SkAutoTDelete<SkSwizzler> fSwizzler; |
127 | 128 |
128 typedef SkCodec INHERITED; | 129 typedef SkCodec INHERITED; |
129 }; | 130 }; |
130 | 131 |
131 #endif | 132 #endif |
OLD | NEW |