| 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 "render_int.h" | 7 #include "render_int.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 FX_BOOL bLoadMask) { | 215 FX_BOOL bLoadMask) { |
| 216 if (!pStream) { | 216 if (!pStream) { |
| 217 return FALSE; | 217 return FALSE; |
| 218 } | 218 } |
| 219 m_pDocument = pDoc; | 219 m_pDocument = pDoc; |
| 220 m_pDict = pStream->GetDict(); | 220 m_pDict = pStream->GetDict(); |
| 221 if (!m_pDict) { | 221 if (!m_pDict) { |
| 222 return FALSE; | 222 return FALSE; |
| 223 } | 223 } |
| 224 m_pStream = pStream; | 224 m_pStream = pStream; |
| 225 m_Width = m_pDict->GetInteger("Width"); | 225 m_Width = m_pDict->GetIntegerBy("Width"); |
| 226 m_Height = m_pDict->GetInteger("Height"); | 226 m_Height = m_pDict->GetIntegerBy("Height"); |
| 227 if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension || | 227 if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension || |
| 228 m_Height > kMaxImageDimension) { | 228 m_Height > kMaxImageDimension) { |
| 229 return FALSE; | 229 return FALSE; |
| 230 } | 230 } |
| 231 m_GroupFamily = GroupFamily; | 231 m_GroupFamily = GroupFamily; |
| 232 m_bLoadMask = bLoadMask; | 232 m_bLoadMask = bLoadMask; |
| 233 if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, | 233 if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, |
| 234 pPageResources)) { | 234 pPageResources)) { |
| 235 return FALSE; | 235 return FALSE; |
| 236 } | 236 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 FX_DWORD GroupFamily, | 335 FX_DWORD GroupFamily, |
| 336 FX_BOOL bLoadMask) { | 336 FX_BOOL bLoadMask) { |
| 337 if (!pStream) { | 337 if (!pStream) { |
| 338 return 0; | 338 return 0; |
| 339 } | 339 } |
| 340 m_pDocument = pDoc; | 340 m_pDocument = pDoc; |
| 341 m_pDict = pStream->GetDict(); | 341 m_pDict = pStream->GetDict(); |
| 342 m_pStream = pStream; | 342 m_pStream = pStream; |
| 343 m_bStdCS = bStdCS; | 343 m_bStdCS = bStdCS; |
| 344 m_bHasMask = bHasMask; | 344 m_bHasMask = bHasMask; |
| 345 m_Width = m_pDict->GetInteger("Width"); | 345 m_Width = m_pDict->GetIntegerBy("Width"); |
| 346 m_Height = m_pDict->GetInteger("Height"); | 346 m_Height = m_pDict->GetIntegerBy("Height"); |
| 347 if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension || | 347 if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension || |
| 348 m_Height > kMaxImageDimension) { | 348 m_Height > kMaxImageDimension) { |
| 349 return 0; | 349 return 0; |
| 350 } | 350 } |
| 351 m_GroupFamily = GroupFamily; | 351 m_GroupFamily = GroupFamily; |
| 352 m_bLoadMask = bLoadMask; | 352 m_bLoadMask = bLoadMask; |
| 353 if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, | 353 if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, |
| 354 pPageResources)) { | 354 pPageResources)) { |
| 355 return 0; | 355 return 0; |
| 356 } | 356 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 if (m_Status == 1) { | 399 if (m_Status == 1) { |
| 400 const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder(); | 400 const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder(); |
| 401 if (decoder == "JPXDecode") { | 401 if (decoder == "JPXDecode") { |
| 402 return 0; | 402 return 0; |
| 403 } | 403 } |
| 404 ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module(); | 404 ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module(); |
| 405 if (!m_pJbig2Context) { | 405 if (!m_pJbig2Context) { |
| 406 m_pJbig2Context = pJbig2Module->CreateJbig2Context(); | 406 m_pJbig2Context = pJbig2Module->CreateJbig2Context(); |
| 407 if (m_pStreamAcc->GetImageParam()) { | 407 if (m_pStreamAcc->GetImageParam()) { |
| 408 CPDF_Stream* pGlobals = | 408 CPDF_Stream* pGlobals = |
| 409 m_pStreamAcc->GetImageParam()->GetStream("JBIG2Globals"); | 409 m_pStreamAcc->GetImageParam()->GetStreamBy("JBIG2Globals"); |
| 410 if (pGlobals) { | 410 if (pGlobals) { |
| 411 m_pGlobalStream = new CPDF_StreamAcc; | 411 m_pGlobalStream = new CPDF_StreamAcc; |
| 412 m_pGlobalStream->LoadAllData(pGlobals, FALSE); | 412 m_pGlobalStream->LoadAllData(pGlobals, FALSE); |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 ret = pJbig2Module->StartDecode(m_pJbig2Context, m_pDocument, m_Width, | 415 ret = pJbig2Module->StartDecode(m_pJbig2Context, m_pDocument, m_Width, |
| 416 m_Height, m_pStreamAcc, m_pGlobalStream, | 416 m_Height, m_pStreamAcc, m_pGlobalStream, |
| 417 m_pCachedBitmap->GetBuffer(), | 417 m_pCachedBitmap->GetBuffer(), |
| 418 m_pCachedBitmap->GetPitch(), pPause); | 418 m_pCachedBitmap->GetPitch(), pPause); |
| 419 if (ret < 0) { | 419 if (ret < 0) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 return ret1; | 466 return ret1; |
| 467 } | 467 } |
| 468 if (m_Status == 2) { | 468 if (m_Status == 2) { |
| 469 return ContinueLoadMaskDIB(pPause); | 469 return ContinueLoadMaskDIB(pPause); |
| 470 } | 470 } |
| 471 return 0; | 471 return 0; |
| 472 } | 472 } |
| 473 | 473 |
| 474 bool CPDF_DIBSource::LoadColorInfo(const CPDF_Dictionary* pFormResources, | 474 bool CPDF_DIBSource::LoadColorInfo(const CPDF_Dictionary* pFormResources, |
| 475 const CPDF_Dictionary* pPageResources) { | 475 const CPDF_Dictionary* pPageResources) { |
| 476 m_bpc_orig = m_pDict->GetInteger("BitsPerComponent"); | 476 m_bpc_orig = m_pDict->GetIntegerBy("BitsPerComponent"); |
| 477 if (m_pDict->GetInteger("ImageMask")) | 477 if (m_pDict->GetIntegerBy("ImageMask")) |
| 478 m_bImageMask = TRUE; | 478 m_bImageMask = TRUE; |
| 479 | 479 |
| 480 if (m_bImageMask || !m_pDict->KeyExist("ColorSpace")) { | 480 if (m_bImageMask || !m_pDict->KeyExist("ColorSpace")) { |
| 481 if (!m_bImageMask) { | 481 if (!m_bImageMask) { |
| 482 CPDF_Object* pFilter = m_pDict->GetElementValue("Filter"); | 482 CPDF_Object* pFilter = m_pDict->GetElementValue("Filter"); |
| 483 if (pFilter) { | 483 if (pFilter) { |
| 484 CFX_ByteString filter; | 484 CFX_ByteString filter; |
| 485 if (pFilter->IsName()) { | 485 if (pFilter->IsName()) { |
| 486 filter = pFilter->GetString(); | 486 filter = pFilter->GetString(); |
| 487 } else if (CPDF_Array* pArray = pFilter->AsArray()) { | 487 } else if (CPDF_Array* pArray = pFilter->AsArray()) { |
| 488 filter = pArray->GetString(pArray->GetCount() - 1); | 488 filter = pArray->GetStringAt(pArray->GetCount() - 1); |
| 489 } | 489 } |
| 490 | 490 |
| 491 if (filter == "JPXDecode") { | 491 if (filter == "JPXDecode") { |
| 492 m_bDoBpcCheck = FALSE; | 492 m_bDoBpcCheck = FALSE; |
| 493 return true; | 493 return true; |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 m_bImageMask = TRUE; | 497 m_bImageMask = TRUE; |
| 498 m_bpc = m_nComponents = 1; | 498 m_bpc = m_nComponents = 1; |
| 499 CPDF_Array* pDecode = m_pDict->GetArray("Decode"); | 499 CPDF_Array* pDecode = m_pDict->GetArrayBy("Decode"); |
| 500 m_bDefaultDecode = !pDecode || !pDecode->GetInteger(0); | 500 m_bDefaultDecode = !pDecode || !pDecode->GetIntegerAt(0); |
| 501 return true; | 501 return true; |
| 502 } | 502 } |
| 503 | 503 |
| 504 CPDF_Object* pCSObj = m_pDict->GetElementValue("ColorSpace"); | 504 CPDF_Object* pCSObj = m_pDict->GetElementValue("ColorSpace"); |
| 505 if (!pCSObj) | 505 if (!pCSObj) |
| 506 return false; | 506 return false; |
| 507 | 507 |
| 508 CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData(); | 508 CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData(); |
| 509 if (pFormResources) | 509 if (pFormResources) |
| 510 m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pFormResources); | 510 m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pFormResources); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 530 return !!m_pCompData; | 530 return !!m_pCompData; |
| 531 } | 531 } |
| 532 | 532 |
| 533 DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, | 533 DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, |
| 534 FX_BOOL& bColorKey) { | 534 FX_BOOL& bColorKey) { |
| 535 if (!m_pColorSpace) { | 535 if (!m_pColorSpace) { |
| 536 return NULL; | 536 return NULL; |
| 537 } | 537 } |
| 538 DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents); | 538 DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents); |
| 539 int max_data = (1 << m_bpc) - 1; | 539 int max_data = (1 << m_bpc) - 1; |
| 540 CPDF_Array* pDecode = m_pDict->GetArray("Decode"); | 540 CPDF_Array* pDecode = m_pDict->GetArrayBy("Decode"); |
| 541 if (pDecode) { | 541 if (pDecode) { |
| 542 for (FX_DWORD i = 0; i < m_nComponents; i++) { | 542 for (FX_DWORD i = 0; i < m_nComponents; i++) { |
| 543 pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2); | 543 pCompData[i].m_DecodeMin = pDecode->GetNumberAt(i * 2); |
| 544 FX_FLOAT max = pDecode->GetNumber(i * 2 + 1); | 544 FX_FLOAT max = pDecode->GetNumberAt(i * 2 + 1); |
| 545 pCompData[i].m_DecodeStep = (max - pCompData[i].m_DecodeMin) / max_data; | 545 pCompData[i].m_DecodeStep = (max - pCompData[i].m_DecodeMin) / max_data; |
| 546 FX_FLOAT def_value, def_min, def_max; | 546 FX_FLOAT def_value, def_min, def_max; |
| 547 m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max); | 547 m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max); |
| 548 if (m_Family == PDFCS_INDEXED) { | 548 if (m_Family == PDFCS_INDEXED) { |
| 549 def_max = (FX_FLOAT)max_data; | 549 def_max = (FX_FLOAT)max_data; |
| 550 } | 550 } |
| 551 if (def_min != pCompData[i].m_DecodeMin || def_max != max) { | 551 if (def_min != pCompData[i].m_DecodeMin || def_max != max) { |
| 552 bDefaultDecode = FALSE; | 552 bDefaultDecode = FALSE; |
| 553 } | 553 } |
| 554 } | 554 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 if (!m_pDict->KeyExist("SMask")) { | 567 if (!m_pDict->KeyExist("SMask")) { |
| 568 CPDF_Object* pMask = m_pDict->GetElementValue("Mask"); | 568 CPDF_Object* pMask = m_pDict->GetElementValue("Mask"); |
| 569 if (!pMask) { | 569 if (!pMask) { |
| 570 return pCompData; | 570 return pCompData; |
| 571 } | 571 } |
| 572 if (CPDF_Array* pArray = pMask->AsArray()) { | 572 if (CPDF_Array* pArray = pMask->AsArray()) { |
| 573 if (pArray->GetCount() >= m_nComponents * 2) { | 573 if (pArray->GetCount() >= m_nComponents * 2) { |
| 574 for (FX_DWORD i = 0; i < m_nComponents; i++) { | 574 for (FX_DWORD i = 0; i < m_nComponents; i++) { |
| 575 int min_num = pArray->GetInteger(i * 2); | 575 int min_num = pArray->GetIntegerAt(i * 2); |
| 576 int max_num = pArray->GetInteger(i * 2 + 1); | 576 int max_num = pArray->GetIntegerAt(i * 2 + 1); |
| 577 pCompData[i].m_ColorKeyMin = std::max(min_num, 0); | 577 pCompData[i].m_ColorKeyMin = std::max(min_num, 0); |
| 578 pCompData[i].m_ColorKeyMax = std::min(max_num, max_data); | 578 pCompData[i].m_ColorKeyMax = std::min(max_num, max_data); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 bColorKey = TRUE; | 581 bColorKey = TRUE; |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 return pCompData; | 584 return pCompData; |
| 585 } | 585 } |
| 586 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder( | 586 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 607 } | 607 } |
| 608 const uint8_t* src_data = m_pStreamAcc->GetData(); | 608 const uint8_t* src_data = m_pStreamAcc->GetData(); |
| 609 FX_DWORD src_size = m_pStreamAcc->GetSize(); | 609 FX_DWORD src_size = m_pStreamAcc->GetSize(); |
| 610 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam(); | 610 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam(); |
| 611 if (decoder == "CCITTFaxDecode") { | 611 if (decoder == "CCITTFaxDecode") { |
| 612 m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, | 612 m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, |
| 613 pParams); | 613 pParams); |
| 614 } else if (decoder == "DCTDecode") { | 614 } else if (decoder == "DCTDecode") { |
| 615 m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( | 615 m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( |
| 616 src_data, src_size, m_Width, m_Height, m_nComponents, | 616 src_data, src_size, m_Width, m_Height, m_nComponents, |
| 617 pParams ? pParams->GetInteger("ColorTransform", 1) : 1); | 617 pParams ? pParams->GetIntegerBy("ColorTransform", 1) : 1); |
| 618 if (!m_pDecoder) { | 618 if (!m_pDecoder) { |
| 619 FX_BOOL bTransform = FALSE; | 619 FX_BOOL bTransform = FALSE; |
| 620 int comps, bpc; | 620 int comps, bpc; |
| 621 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); | 621 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); |
| 622 if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, | 622 if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, |
| 623 bpc, bTransform)) { | 623 bpc, bTransform)) { |
| 624 if (m_nComponents != comps) { | 624 if (m_nComponents != comps) { |
| 625 FX_Free(m_pCompData); | 625 FX_Free(m_pCompData); |
| 626 m_nComponents = comps; | 626 m_nComponents = comps; |
| 627 if (m_Family == PDFCS_LAB && m_nComponents != 3) { | 627 if (m_Family == PDFCS_LAB && m_nComponents != 3) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 for (FX_DWORD col = 0; col < width; ++col) { | 752 for (FX_DWORD col = 0; col < width; ++col) { |
| 753 *scanline = (*scanline) >> scale; | 753 *scanline = (*scanline) >> scale; |
| 754 ++scanline; | 754 ++scanline; |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 m_bpc = 8; | 758 m_bpc = 8; |
| 759 } | 759 } |
| 760 CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) { | 760 CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) { |
| 761 MatteColor = 0xFFFFFFFF; | 761 MatteColor = 0xFFFFFFFF; |
| 762 CPDF_Stream* pSoftMask = m_pDict->GetStream("SMask"); | 762 CPDF_Stream* pSoftMask = m_pDict->GetStreamBy("SMask"); |
| 763 if (pSoftMask) { | 763 if (pSoftMask) { |
| 764 CPDF_Array* pMatte = pSoftMask->GetDict()->GetArray("Matte"); | 764 CPDF_Array* pMatte = pSoftMask->GetDict()->GetArrayBy("Matte"); |
| 765 if (pMatte && m_pColorSpace && | 765 if (pMatte && m_pColorSpace && |
| 766 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) { | 766 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) { |
| 767 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents); | 767 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents); |
| 768 for (FX_DWORD i = 0; i < m_nComponents; i++) { | 768 for (FX_DWORD i = 0; i < m_nComponents; i++) { |
| 769 pColor[i] = pMatte->GetFloat(i); | 769 pColor[i] = pMatte->GetFloatAt(i); |
| 770 } | 770 } |
| 771 FX_FLOAT R, G, B; | 771 FX_FLOAT R, G, B; |
| 772 m_pColorSpace->GetRGB(pColor, R, G, B); | 772 m_pColorSpace->GetRGB(pColor, R, G, B); |
| 773 FX_Free(pColor); | 773 FX_Free(pColor); |
| 774 MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), | 774 MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), |
| 775 FXSYS_round(B * 255)); | 775 FXSYS_round(B * 255)); |
| 776 } | 776 } |
| 777 return LoadMaskDIB(pSoftMask); | 777 return LoadMaskDIB(pSoftMask); |
| 778 } | 778 } |
| 779 | 779 |
| 780 if (CPDF_Stream* pStream = ToStream(m_pDict->GetElementValue("Mask"))) | 780 if (CPDF_Stream* pStream = ToStream(m_pDict->GetElementValue("Mask"))) |
| 781 return LoadMaskDIB(pStream); | 781 return LoadMaskDIB(pStream); |
| 782 | 782 |
| 783 return nullptr; | 783 return nullptr; |
| 784 } | 784 } |
| 785 int CPDF_DIBSource::StratLoadMask() { | 785 int CPDF_DIBSource::StratLoadMask() { |
| 786 m_MatteColor = 0XFFFFFFFF; | 786 m_MatteColor = 0XFFFFFFFF; |
| 787 m_pMaskStream = m_pDict->GetStream("SMask"); | 787 m_pMaskStream = m_pDict->GetStreamBy("SMask"); |
| 788 if (m_pMaskStream) { | 788 if (m_pMaskStream) { |
| 789 CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray("Matte"); | 789 CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArrayBy("Matte"); |
| 790 if (pMatte && m_pColorSpace && | 790 if (pMatte && m_pColorSpace && |
| 791 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) { | 791 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) { |
| 792 FX_FLOAT R, G, B; | 792 FX_FLOAT R, G, B; |
| 793 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents); | 793 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents); |
| 794 for (FX_DWORD i = 0; i < m_nComponents; i++) { | 794 for (FX_DWORD i = 0; i < m_nComponents; i++) { |
| 795 pColor[i] = pMatte->GetFloat(i); | 795 pColor[i] = pMatte->GetFloatAt(i); |
| 796 } | 796 } |
| 797 m_pColorSpace->GetRGB(pColor, R, G, B); | 797 m_pColorSpace->GetRGB(pColor, R, G, B); |
| 798 FX_Free(pColor); | 798 FX_Free(pColor); |
| 799 m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), | 799 m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), |
| 800 FXSYS_round(B * 255)); | 800 FXSYS_round(B * 255)); |
| 801 } | 801 } |
| 802 return StartLoadMaskDIB(); | 802 return StartLoadMaskDIB(); |
| 803 } | 803 } |
| 804 | 804 |
| 805 m_pMaskStream = ToStream(m_pDict->GetElementValue("Mask")); | 805 m_pMaskStream = ToStream(m_pDict->GetElementValue("Mask")); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 m_bpc = 1; | 932 m_bpc = 1; |
| 933 m_nComponents = 1; | 933 m_nComponents = 1; |
| 934 } else if (filter == "RunLengthDecode") { | 934 } else if (filter == "RunLengthDecode") { |
| 935 if (m_bpc != 1) { | 935 if (m_bpc != 1) { |
| 936 m_bpc = 8; | 936 m_bpc = 8; |
| 937 } | 937 } |
| 938 } else if (filter == "DCTDecode") { | 938 } else if (filter == "DCTDecode") { |
| 939 m_bpc = 8; | 939 m_bpc = 8; |
| 940 } | 940 } |
| 941 } else if (CPDF_Array* pArray = pFilter->AsArray()) { | 941 } else if (CPDF_Array* pArray = pFilter->AsArray()) { |
| 942 CFX_ByteString filter = pArray->GetString(pArray->GetCount() - 1); | 942 CFX_ByteString filter = pArray->GetStringAt(pArray->GetCount() - 1); |
| 943 if (filter == "CCITTFaxDecode" || filter == "JBIG2Decode") { | 943 if (filter == "CCITTFaxDecode" || filter == "JBIG2Decode") { |
| 944 m_bpc = 1; | 944 m_bpc = 1; |
| 945 m_nComponents = 1; | 945 m_nComponents = 1; |
| 946 } else if (filter == "DCTDecode") { | 946 } else if (filter == "DCTDecode") { |
| 947 // Previously, filter == "RunLengthDecode" was checked in the "if" | 947 // Previously, filter == "RunLengthDecode" was checked in the "if" |
| 948 // statement as well, but too many documents don't conform to it. | 948 // statement as well, but too many documents don't conform to it. |
| 949 m_bpc = 8; | 949 m_bpc = 8; |
| 950 } | 950 } |
| 951 } | 951 } |
| 952 } | 952 } |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, | 1621 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, |
| 1622 IFX_Pause* pPause) { | 1622 IFX_Pause* pPause) { |
| 1623 return LoadHandle->Continue(pPause); | 1623 return LoadHandle->Continue(pPause); |
| 1624 } | 1624 } |
| 1625 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1625 CPDF_ImageLoader::~CPDF_ImageLoader() { |
| 1626 if (!m_bCached) { | 1626 if (!m_bCached) { |
| 1627 delete m_pBitmap; | 1627 delete m_pBitmap; |
| 1628 delete m_pMask; | 1628 delete m_pMask; |
| 1629 } | 1629 } |
| 1630 } | 1630 } |
| OLD | NEW |