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 #ifndef SkBmpCodec_DEFINED | 7 #ifndef SkBmpCodec_DEFINED |
8 #define SkBmpCodec_DEFINED | 8 #define SkBmpCodec_DEFINED |
9 | 9 |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 */ | 89 */ |
90 int32_t getDstRow(int32_t y, int32_t height); | 90 int32_t getDstRow(int32_t y, int32_t height); |
91 | 91 |
92 /* | 92 /* |
93 * Get the destination row to start filling from | 93 * Get the destination row to start filling from |
94 * Used to fill the remainder of the image on incomplete input for bmps | 94 * Used to fill the remainder of the image on incomplete input for bmps |
95 * This is tricky since bmps may be kTopDown or kBottomUp. For kTopDown, | 95 * This is tricky since bmps may be kTopDown or kBottomUp. For kTopDown, |
96 * we start filling from where we left off, but for kBottomUp we start | 96 * we start filling from where we left off, but for kBottomUp we start |
97 * filling at the top of the image. | 97 * filling at the top of the image. |
98 */ | 98 */ |
99 void* getDstStartRow(void* dst, size_t dstRowBytes, int32_t y) const; | 99 void* onGetFillDst(void* dst, size_t dstRowBytes, uint32_t decodedScanlines)
const override; |
100 | 100 |
101 /* | 101 /* |
102 * Compute the number of colors in the color table | 102 * Compute the number of colors in the color table |
103 */ | 103 */ |
104 uint32_t computeNumColors(uint32_t numColors); | 104 uint32_t computeNumColors(uint32_t numColors); |
105 | 105 |
106 /* | 106 /* |
107 * Accessors used by subclasses | 107 * Accessors used by subclasses |
108 */ | 108 */ |
109 uint16_t bitsPerPixel() const { return fBitsPerPixel; } | 109 uint16_t bitsPerPixel() const { return fBitsPerPixel; } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 * onGetPixels() uses this for full image decodes. | 142 * onGetPixels() uses this for full image decodes. |
143 * SkScaledCodec::onGetPixels() uses the scanline decoder to call this with | 143 * SkScaledCodec::onGetPixels() uses the scanline decoder to call this with |
144 * dstInfo.height() = 1, in order to implement sampling. | 144 * dstInfo.height() = 1, in order to implement sampling. |
145 * A potential future use is to allow the caller to decode a subset of the | 145 * A potential future use is to allow the caller to decode a subset of the |
146 * lines in the image. | 146 * lines in the image. |
147 * | 147 * |
148 * @param dstInfo Contains output information. Height specifies the | 148 * @param dstInfo Contains output information. Height specifies the |
149 * number of rows to decode at this time. | 149 * number of rows to decode at this time. |
150 * @param dst Memory location to store output pixels | 150 * @param dst Memory location to store output pixels |
151 * @param dstRowBytes Bytes in a row of the destination | 151 * @param dstRowBytes Bytes in a row of the destination |
| 152 * @return Number of rows successfully decoded |
152 */ | 153 */ |
153 virtual Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstR
owBytes, | 154 virtual uint32_t decodeRows(const SkImageInfo& dstInfo, void* dst, size_t ds
tRowBytes, |
154 const Options& opts) = 0; | 155 const Options& opts) = 0; |
155 | 156 |
156 const uint16_t fBitsPerPixel; | 157 const uint16_t fBitsPerPixel; |
157 const SkScanlineDecoder::SkScanlineOrder fRowOrder; | 158 const SkScanlineDecoder::SkScanlineOrder fRowOrder; |
158 | 159 |
159 friend class SkBmpScanlineDecoder; | 160 friend class SkBmpScanlineDecoder; |
160 | 161 |
161 typedef SkCodec INHERITED; | 162 typedef SkCodec INHERITED; |
162 }; | 163 }; |
163 | 164 |
164 #endif | 165 #endif |
OLD | NEW |