| 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 "../../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
| 9 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
| 10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 m_bpc = m_bpc_orig; | 958 m_bpc = m_bpc_orig; |
| 959 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); | 959 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); |
| 960 if (pFilter) { | 960 if (pFilter) { |
| 961 if (pFilter->GetType() == PDFOBJ_NAME) { | 961 if (pFilter->GetType() == PDFOBJ_NAME) { |
| 962 CFX_ByteString filter = pFilter->GetString(); | 962 CFX_ByteString filter = pFilter->GetString(); |
| 963 if (filter == FX_BSTRC("CCITTFaxDecode") || | 963 if (filter == FX_BSTRC("CCITTFaxDecode") || |
| 964 filter == FX_BSTRC("JBIG2Decode")) { | 964 filter == FX_BSTRC("JBIG2Decode")) { |
| 965 m_bpc = 1; | 965 m_bpc = 1; |
| 966 m_nComponents = 1; | 966 m_nComponents = 1; |
| 967 } | 967 } |
| 968 if (filter == FX_BSTRC("RunLengthDecode") || | 968 if (filter == FX_BSTRC("RunLengthDecode")) { |
| 969 filter == FX_BSTRC("DCTDecode")) { | 969 if (m_bpc != 1) { |
| 970 m_bpc = 8; |
| 971 } |
| 972 } else if (filter == FX_BSTRC("DCTDecode")) { |
| 970 m_bpc = 8; | 973 m_bpc = 8; |
| 971 } | 974 } |
| 972 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { | 975 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { |
| 973 CPDF_Array* pArray = (CPDF_Array*)pFilter; | 976 CPDF_Array* pArray = (CPDF_Array*)pFilter; |
| 974 if (pArray->GetString(pArray->GetCount() - 1) == | 977 if (pArray->GetString(pArray->GetCount() - 1) == |
| 975 FX_BSTRC("CCITTFaxDecode") || | 978 FX_BSTRC("CCITTFaxDecode") || |
| 976 pArray->GetString(pArray->GetCount() - 1) == | 979 pArray->GetString(pArray->GetCount() - 1) == |
| 977 FX_BSTRC("JBIG2Decode")) { | 980 FX_BSTRC("JBIG2Decode")) { |
| 978 m_bpc = 1; | 981 m_bpc = 1; |
| 979 m_nComponents = 1; | 982 m_nComponents = 1; |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 } | 1642 } |
| 1640 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1643 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
| 1641 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1644 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
| 1642 } | 1645 } |
| 1643 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1646 CPDF_ImageLoader::~CPDF_ImageLoader() { |
| 1644 if (!m_bCached) { | 1647 if (!m_bCached) { |
| 1645 delete m_pBitmap; | 1648 delete m_pBitmap; |
| 1646 delete m_pMask; | 1649 delete m_pMask; |
| 1647 } | 1650 } |
| 1648 } | 1651 } |
| OLD | NEW |