Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp

Issue 1417893003: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->IsName()) { 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 (CPDF_Array* pArray = pFilters->AsArray()) {
416 CPDF_Array* pArray = (CPDF_Array*)pFilters;
417 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { 416 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
418 CFX_ByteStringC bsDecodeType = pArray->GetConstString(i); 417 CFX_ByteStringC bsDecodeType = pArray->GetConstString(i);
419 if (bsDecodeType == FX_BSTRC("DCTDecode") || 418 if (bsDecodeType == FX_BSTRC("DCTDecode") ||
420 bsDecodeType == FX_BSTRC("JPXDecode")) { 419 bsDecodeType == FX_BSTRC("JPXDecode")) {
421 m_Flags |= FXRENDER_IMAGE_LOSSY; 420 m_Flags |= FXRENDER_IMAGE_LOSSY;
422 break; 421 break;
423 } 422 }
424 } 423 }
425 } 424 }
426 } 425 }
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 for (int i = 0; i < size; i++) { 1166 for (int i = 0; i < size; i++) {
1168 dest_buf[i] = pTransfer[src_buf[i]]; 1167 dest_buf[i] = pTransfer[src_buf[i]];
1169 } 1168 }
1170 } else { 1169 } else {
1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); 1170 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
1172 } 1171 }
1173 delete pFunc; 1172 delete pFunc;
1174 FX_Free(pTransfer); 1173 FX_Free(pTransfer);
1175 return pMask; 1174 return pMask;
1176 } 1175 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698