OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxcodec/codec/codec_int.h" | 7 #include "core/fxcodec/codec/codec_int.h" |
8 #include "core/fxcodec/include/fx_codec.h" | 8 #include "core/fxcodec/include/fx_codec.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 | 530 |
531 FX_BOOL CCodec_FaxDecoder::v_Rewind() { | 531 FX_BOOL CCodec_FaxDecoder::v_Rewind() { |
532 FXSYS_memset(m_pRefBuf, 0xff, m_Pitch); | 532 FXSYS_memset(m_pRefBuf, 0xff, m_Pitch); |
533 bitpos = 0; | 533 bitpos = 0; |
534 return TRUE; | 534 return TRUE; |
535 } | 535 } |
536 uint8_t* CCodec_FaxDecoder::v_GetNextLine() { | 536 uint8_t* CCodec_FaxDecoder::v_GetNextLine() { |
537 int bitsize = m_SrcSize * 8; | 537 int bitsize = m_SrcSize * 8; |
538 FaxSkipEOL(m_pSrcBuf, bitsize, bitpos); | 538 FaxSkipEOL(m_pSrcBuf, bitsize, bitpos); |
539 if (bitpos >= bitsize) { | 539 if (bitpos >= bitsize) { |
540 return NULL; | 540 return nullptr; |
541 } | 541 } |
542 FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch); | 542 FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch); |
543 if (m_Encoding < 0) { | 543 if (m_Encoding < 0) { |
544 FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, | 544 FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, |
545 m_OrigWidth); | 545 m_OrigWidth); |
546 FXSYS_memcpy(m_pRefBuf, m_pScanlineBuf, m_Pitch); | 546 FXSYS_memcpy(m_pRefBuf, m_pScanlineBuf, m_Pitch); |
547 } else if (m_Encoding == 0) { | 547 } else if (m_Encoding == 0) { |
548 FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth); | 548 FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth); |
549 } else { | 549 } else { |
550 FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8)); | 550 FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 int height, | 620 int height, |
621 int K, | 621 int K, |
622 FX_BOOL EndOfLine, | 622 FX_BOOL EndOfLine, |
623 FX_BOOL EncodedByteAlign, | 623 FX_BOOL EncodedByteAlign, |
624 FX_BOOL BlackIs1, | 624 FX_BOOL BlackIs1, |
625 int Columns, | 625 int Columns, |
626 int Rows) { | 626 int Rows) { |
627 return new CCodec_FaxDecoder(src_buf, src_size, width, height, K, EndOfLine, | 627 return new CCodec_FaxDecoder(src_buf, src_size, width, height, K, EndOfLine, |
628 EncodedByteAlign, BlackIs1, Columns, Rows); | 628 EncodedByteAlign, BlackIs1, Columns, Rows); |
629 } | 629 } |
OLD | NEW |