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 #include "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void setPixel(void* dst, size_t dstRowBytes, | 77 void setPixel(void* dst, size_t dstRowBytes, |
78 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, | 78 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, |
79 uint8_t index); | 79 uint8_t index); |
80 /* | 80 /* |
81 * Set an RLE24 pixel from R, G, B values | 81 * Set an RLE24 pixel from R, G, B values |
82 */ | 82 */ |
83 void setRGBPixel(void* dst, size_t dstRowBytes, | 83 void setRGBPixel(void* dst, size_t dstRowBytes, |
84 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, | 84 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, |
85 uint8_t red, uint8_t green, uint8_t blue); | 85 uint8_t red, uint8_t green, uint8_t blue); |
86 | 86 |
| 87 /* |
| 88 * If dst is NULL, this is a signal to skip the rows. |
| 89 */ |
87 int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, | 90 int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, |
88 const Options& opts) override; | 91 const Options& opts) override; |
89 | 92 |
| 93 bool skipRows(int count) override; |
| 94 |
90 SkSampler* getSampler(bool createIfNecessary) override; | 95 SkSampler* getSampler(bool createIfNecessary) override; |
91 | 96 |
92 SkAutoTUnref<SkColorTable> fColorTable; // owned | 97 SkAutoTUnref<SkColorTable> fColorTable; // owned |
93 // fNumColors is the number specified in the header, or 0 if not present in
the header. | 98 // fNumColors is the number specified in the header, or 0 if not present in
the header. |
94 const uint32_t fNumColors; | 99 const uint32_t fNumColors; |
95 const uint32_t fBytesPerColor; | 100 const uint32_t fBytesPerColor; |
96 const uint32_t fOffset; | 101 const uint32_t fOffset; |
97 SkAutoTDeleteArray<uint8_t> fStreamBuffer; | 102 SkAutoTDeleteArray<uint8_t> fStreamBuffer; |
98 size_t fRLEBytes; | 103 size_t fRLEBytes; |
99 const size_t fOrigRLEBytes; | 104 const size_t fOrigRLEBytes; |
100 uint32_t fCurrRLEByte; | 105 uint32_t fCurrRLEByte; |
101 int fSampleX; | 106 int fSampleX; |
102 SkAutoTDelete<SkSampler> fSampler; | 107 SkAutoTDelete<SkSampler> fSampler; |
103 | 108 |
104 // Scanline decodes allow the client to ask for a single scanline at a time. | 109 // Scanline decodes allow the client to ask for a single scanline at a time. |
105 // This can be tricky when the RLE encoding instructs the decoder to jump do
wn | 110 // This can be tricky when the RLE encoding instructs the decoder to jump do
wn |
106 // multiple lines. This field keeps track of lines that need to be skipped | 111 // multiple lines. This field keeps track of lines that need to be skipped |
107 // on subsequent calls to decodeRows(). | 112 // on subsequent calls to decodeRows(). |
108 int fLinesToSkip; | 113 int fLinesToSkip; |
109 | 114 |
110 typedef SkBmpCodec INHERITED; | 115 typedef SkBmpCodec INHERITED; |
111 }; | 116 }; |
OLD | NEW |