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/include/fx_codec.h" | 7 #include "core/fxcodec/include/fx_codec.h" |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <memory> | 10 #include <memory> |
(...skipping 13 matching lines...) Expand all Loading... |
24 m_pIccModule(new CCodec_IccModule), | 24 m_pIccModule(new CCodec_IccModule), |
25 #ifdef PDF_ENABLE_XFA | 25 #ifdef PDF_ENABLE_XFA |
26 m_pPngModule(new CCodec_PngModule), | 26 m_pPngModule(new CCodec_PngModule), |
27 m_pGifModule(new CCodec_GifModule), | 27 m_pGifModule(new CCodec_GifModule), |
28 m_pBmpModule(new CCodec_BmpModule), | 28 m_pBmpModule(new CCodec_BmpModule), |
29 m_pTiffModule(new CCodec_TiffModule), | 29 m_pTiffModule(new CCodec_TiffModule), |
30 #endif // PDF_ENABLE_XFA | 30 #endif // PDF_ENABLE_XFA |
31 m_pFlateModule(new CCodec_FlateModule) { | 31 m_pFlateModule(new CCodec_FlateModule) { |
32 } | 32 } |
33 | 33 |
| 34 CCodec_ModuleMgr::~CCodec_ModuleMgr() {} |
| 35 |
34 CCodec_ScanlineDecoder::CCodec_ScanlineDecoder() | 36 CCodec_ScanlineDecoder::CCodec_ScanlineDecoder() |
35 : m_NextLine(-1), m_pLastScanline(nullptr) {} | 37 : m_NextLine(-1), m_pLastScanline(nullptr) {} |
36 | 38 |
37 CCodec_ScanlineDecoder::~CCodec_ScanlineDecoder() {} | 39 CCodec_ScanlineDecoder::~CCodec_ScanlineDecoder() {} |
38 | 40 |
39 const uint8_t* CCodec_ScanlineDecoder::GetScanline(int line) { | 41 const uint8_t* CCodec_ScanlineDecoder::GetScanline(int line) { |
40 if (m_NextLine == line + 1) | 42 if (m_NextLine == line + 1) |
41 return m_pLastScanline; | 43 return m_pLastScanline; |
42 | 44 |
43 if (m_NextLine < 0 || m_NextLine > line) { | 45 if (m_NextLine < 0 || m_NextLine > line) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 int bpc) { | 294 int bpc) { |
293 std::unique_ptr<CCodec_RLScanlineDecoder> pRLScanlineDecoder( | 295 std::unique_ptr<CCodec_RLScanlineDecoder> pRLScanlineDecoder( |
294 new CCodec_RLScanlineDecoder); | 296 new CCodec_RLScanlineDecoder); |
295 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, | 297 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, |
296 bpc)) { | 298 bpc)) { |
297 return nullptr; | 299 return nullptr; |
298 } | 300 } |
299 | 301 |
300 return pRLScanlineDecoder.release(); | 302 return pRLScanlineDecoder.release(); |
301 } | 303 } |
OLD | NEW |