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 "core/src/fpdfapi/fpdf_render/render_int.h" | 7 #include "core/fpdfapi/fpdf_render/render_int.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "core/fpdfapi/fpdf_page/pageint.h" |
12 #include "core/include/fpdfapi/cpdf_array.h" | 13 #include "core/include/fpdfapi/cpdf_array.h" |
13 #include "core/include/fpdfapi/cpdf_dictionary.h" | 14 #include "core/include/fpdfapi/cpdf_dictionary.h" |
14 #include "core/include/fpdfapi/cpdf_document.h" | 15 #include "core/include/fpdfapi/cpdf_document.h" |
15 #include "core/include/fpdfapi/fpdf_module.h" | 16 #include "core/include/fpdfapi/fpdf_module.h" |
16 #include "core/include/fpdfapi/fpdf_pageobj.h" | 17 #include "core/include/fpdfapi/fpdf_pageobj.h" |
17 #include "core/include/fpdfapi/fpdf_render.h" | 18 #include "core/include/fpdfapi/fpdf_render.h" |
18 #include "core/include/fxcodec/fx_codec.h" | 19 #include "core/include/fxcodec/fx_codec.h" |
19 #include "core/include/fxcrt/fx_safe_types.h" | 20 #include "core/include/fxcrt/fx_safe_types.h" |
20 #include "core/include/fxge/fx_ge.h" | 21 #include "core/include/fxge/fx_ge.h" |
21 #include "core/src/fpdfapi/fpdf_page/pageint.h" | |
22 | 22 |
23 FX_BOOL CPDF_RenderStatus::ProcessImage(const CPDF_ImageObject* pImageObj, | 23 FX_BOOL CPDF_RenderStatus::ProcessImage(const CPDF_ImageObject* pImageObj, |
24 const CFX_Matrix* pObj2Device) { | 24 const CFX_Matrix* pObj2Device) { |
25 CPDF_ImageRenderer render; | 25 CPDF_ImageRenderer render; |
26 if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) { | 26 if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) { |
27 render.Continue(NULL); | 27 render.Continue(NULL); |
28 } | 28 } |
29 return render.m_Result; | 29 return render.m_Result; |
30 } | 30 } |
31 void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, | 31 void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 m_Samples[512 + FXSYS_GetBValue(rgb)]); | 144 m_Samples[512 + FXSYS_GetBValue(rgb)]); |
145 } | 145 } |
146 | 146 |
147 CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, | 147 CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, |
148 FX_BOOL bAutoDropSrc) { | 148 FX_BOOL bAutoDropSrc) { |
149 CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this); | 149 CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this); |
150 pDest->LoadSrc(pSrc, bAutoDropSrc); | 150 pDest->LoadSrc(pSrc, bAutoDropSrc); |
151 return pDest; | 151 return pDest; |
152 } | 152 } |
153 | 153 |
154 CPDF_DIBTransferFunc::~CPDF_DIBTransferFunc() { | 154 CPDF_DIBTransferFunc::~CPDF_DIBTransferFunc() {} |
155 } | |
156 | 155 |
157 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { | 156 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { |
158 if (m_pSrc->IsAlphaMask()) { | 157 if (m_pSrc->IsAlphaMask()) { |
159 return FXDIB_8bppMask; | 158 return FXDIB_8bppMask; |
160 } | 159 } |
161 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 160 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
162 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; | 161 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; |
163 #else | 162 #else |
164 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; | 163 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; |
165 #endif | 164 #endif |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 } else if (pFunc) { | 989 } else if (pFunc) { |
991 int size = dest_pitch * height; | 990 int size = dest_pitch * height; |
992 for (int i = 0; i < size; i++) { | 991 for (int i = 0; i < size; i++) { |
993 dest_buf[i] = transfers[src_buf[i]]; | 992 dest_buf[i] = transfers[src_buf[i]]; |
994 } | 993 } |
995 } else { | 994 } else { |
996 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 995 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
997 } | 996 } |
998 return pMask.release(); | 997 return pMask.release(); |
999 } | 998 } |
OLD | NEW |