OLD | NEW |
---|---|
1 // Copyright 2016 The PDFium Authors. All rights reserved. | 1 // Copyright 2016 The PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <cstdint> | 5 #include <cstdint> |
6 #include <memory> | 6 #include <memory> |
7 | 7 |
8 #include "core/fxcodec/codec/ccodec_faxmodule.h" | 8 #include "core/fxcodec/codec/ccodec_faxmodule.h" |
9 #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" | 9 #include "core/fxcodec/codec/ccodec_scanlinedecoder.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... | |
22 int K = GetInteger(data + 8); | 22 int K = GetInteger(data + 8); |
23 int Columns = GetInteger(data + 12); | 23 int Columns = GetInteger(data + 12); |
24 int Rows = GetInteger(data + 16); | 24 int Rows = GetInteger(data + 16); |
25 FX_BOOL EndOfLine = (data[20] & 0x01) == 0; | 25 FX_BOOL EndOfLine = (data[20] & 0x01) == 0; |
26 FX_BOOL ByteAlign = (data[20] & 0x02) == 0; | 26 FX_BOOL ByteAlign = (data[20] & 0x02) == 0; |
27 FX_BOOL BlackIs1 = (data[20] & 0x04) == 0; | 27 FX_BOOL BlackIs1 = (data[20] & 0x04) == 0; |
28 data += kParameterSize; | 28 data += kParameterSize; |
29 size -= kParameterSize; | 29 size -= kParameterSize; |
30 | 30 |
31 CCodec_FaxModule fax_module; | 31 CCodec_FaxModule fax_module; |
32 std::unique_ptr<CCodec_ScanlineDecoder> decoder; | 32 std::unique_ptr<CCodec_ScanlineDecoder> decoder; |
Tom Sepez
2016/09/23 16:05:33
nit: combine wth next line
std::unique_ptr<CCodec
Lei Zhang
2016/09/23 16:15:46
I have a CL to clean up the nits. So let's just la
| |
33 decoder.reset(fax_module.CreateDecoder(data, size, width, height, K, | 33 decoder.reset(fax_module.CreateDecoder(data, size, width, height, K, |
34 EndOfLine, ByteAlign, BlackIs1, | 34 EndOfLine, ByteAlign, BlackIs1, |
35 Columns, Rows)); | 35 Columns, Rows)); |
36 | 36 |
37 int line = 0; | 37 if (decoder) { |
38 while (decoder->GetScanline(line)) | 38 int line = 0; |
39 line++; | 39 while (decoder->GetScanline(line)) |
40 line++; | |
41 } | |
40 | 42 |
41 return 0; | 43 return 0; |
42 } | 44 } |
OLD | NEW |