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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 } else { | 907 } else { |
908 m_pColorSpace->GetRGB(color_value, R, G, B); | 908 m_pColorSpace->GetRGB(color_value, R, G, B); |
909 } | 909 } |
910 SetPaletteArgb(i, ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(
G * 255), FXSYS_round(B * 255))); | 910 SetPaletteArgb(i, ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(
G * 255), FXSYS_round(B * 255))); |
911 } | 911 } |
912 } | 912 } |
913 } | 913 } |
914 FX_DWORD CPDF_DIBSource::GetValidBpp() const | 914 FX_DWORD CPDF_DIBSource::GetValidBpp() const |
915 { | 915 { |
916 FX_DWORD bpc = m_bpc; | 916 FX_DWORD bpc = m_bpc; |
917 CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); | 917 » CPDF_Object * pFilter = m_pDict ? m_pDict->GetElementValue(FX_BSTRC("Fil
ter")) : NULL; |
918 if (pFilter) { | 918 if (pFilter) { |
919 if (pFilter->GetType() == PDFOBJ_NAME) { | 919 if (pFilter->GetType() == PDFOBJ_NAME) { |
920 CFX_ByteString filter = pFilter->GetString(); | 920 CFX_ByteString filter = pFilter->GetString(); |
921 if (filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG
2Decode")) { | 921 if (filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG
2Decode")) { |
922 bpc = 1; | 922 bpc = 1; |
923 } | 923 } |
924 if (filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCT
Decode")) { | 924 if (filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCT
Decode")) { |
925 bpc = 8; | 925 bpc = 8; |
926 } | 926 } |
927 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { | 927 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 if (!m_bCached) { | 1507 if (!m_bCached) { |
1508 if (m_pBitmap) { | 1508 if (m_pBitmap) { |
1509 delete m_pBitmap; | 1509 delete m_pBitmap; |
1510 m_pBitmap = NULL; | 1510 m_pBitmap = NULL; |
1511 } | 1511 } |
1512 if (m_pMask) { | 1512 if (m_pMask) { |
1513 delete m_pMask; | 1513 delete m_pMask; |
1514 } | 1514 } |
1515 } | 1515 } |
1516 } | 1516 } |
OLD | NEW |