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/fpdfapi/fpdf_module.h" | 7 #include "../../../include/fpdfapi/fpdf_module.h" |
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../../include/fpdfapi/fpdf_render.h" | 9 #include "../../../include/fpdfapi/fpdf_render.h" |
10 #include "../../../include/fxcodec/fx_codec.h" | 10 #include "../../../include/fxcodec/fx_codec.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) { | 399 if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) { |
400 m_Flags |= RENDER_FORCE_DOWNSAMPLE; | 400 m_Flags |= RENDER_FORCE_DOWNSAMPLE; |
401 } else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) { | 401 } else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) { |
402 m_Flags |= RENDER_FORCE_HALFTONE; | 402 m_Flags |= RENDER_FORCE_HALFTONE; |
403 } | 403 } |
404 if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) { | 404 if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) { |
405 CPDF_Object* pFilters = | 405 CPDF_Object* pFilters = |
406 m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue( | 406 m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue( |
407 FX_BSTRC("Filter")); | 407 FX_BSTRC("Filter")); |
408 if (pFilters) { | 408 if (pFilters) { |
409 if (pFilters->GetType() == PDFOBJ_NAME) { | 409 if (pFilters->IsName()) { |
410 CFX_ByteStringC bsDecodeType = pFilters->GetConstString(); | 410 CFX_ByteStringC bsDecodeType = pFilters->GetConstString(); |
411 if (bsDecodeType == FX_BSTRC("DCTDecode") || | 411 if (bsDecodeType == FX_BSTRC("DCTDecode") || |
412 bsDecodeType == FX_BSTRC("JPXDecode")) { | 412 bsDecodeType == FX_BSTRC("JPXDecode")) { |
413 m_Flags |= FXRENDER_IMAGE_LOSSY; | 413 m_Flags |= FXRENDER_IMAGE_LOSSY; |
414 } | 414 } |
415 } else if (pFilters->GetType() == PDFOBJ_ARRAY) { | 415 } else if (pFilters->GetType() == PDFOBJ_ARRAY) { |
416 CPDF_Array* pArray = (CPDF_Array*)pFilters; | 416 CPDF_Array* pArray = (CPDF_Array*)pFilters; |
417 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { | 417 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { |
418 CFX_ByteStringC bsDecodeType = pArray->GetConstString(i); | 418 CFX_ByteStringC bsDecodeType = pArray->GetConstString(i); |
419 if (bsDecodeType == FX_BSTRC("DCTDecode") || | 419 if (bsDecodeType == FX_BSTRC("DCTDecode") || |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 for (int i = 0; i < size; i++) { | 1167 for (int i = 0; i < size; i++) { |
1168 dest_buf[i] = pTransfer[src_buf[i]]; | 1168 dest_buf[i] = pTransfer[src_buf[i]]; |
1169 } | 1169 } |
1170 } else { | 1170 } else { |
1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
1172 } | 1172 } |
1173 delete pFunc; | 1173 delete pFunc; |
1174 FX_Free(pTransfer); | 1174 FX_Free(pTransfer); |
1175 return pMask; | 1175 return pMask; |
1176 } | 1176 } |
OLD | NEW |