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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], | 132 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], |
133 m_Samples[256 + FXSYS_GetGValue(rgb)], | 133 m_Samples[256 + FXSYS_GetGValue(rgb)], |
134 m_Samples[512 + FXSYS_GetBValue(rgb)]); | 134 m_Samples[512 + FXSYS_GetBValue(rgb)]); |
135 } | 135 } |
136 CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, | 136 CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, |
137 FX_BOOL bAutoDropSrc) { | 137 FX_BOOL bAutoDropSrc) { |
138 CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this); | 138 CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this); |
139 pDest->LoadSrc(pSrc, bAutoDropSrc); | 139 pDest->LoadSrc(pSrc, bAutoDropSrc); |
140 return pDest; | 140 return pDest; |
141 } | 141 } |
| 142 |
| 143 CPDF_DIBTransferFunc::~CPDF_DIBTransferFunc() { |
| 144 } |
| 145 |
142 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { | 146 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { |
143 if (m_pSrc->IsAlphaMask()) { | 147 if (m_pSrc->IsAlphaMask()) { |
144 return FXDIB_8bppMask; | 148 return FXDIB_8bppMask; |
145 } | 149 } |
146 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 150 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
147 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; | 151 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; |
148 #else | 152 #else |
149 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; | 153 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; |
150 #endif | 154 #endif |
151 } | 155 } |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 for (int i = 0; i < size; i++) { | 1167 for (int i = 0; i < size; i++) { |
1164 dest_buf[i] = pTransfer[src_buf[i]]; | 1168 dest_buf[i] = pTransfer[src_buf[i]]; |
1165 } | 1169 } |
1166 } else { | 1170 } else { |
1167 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
1168 } | 1172 } |
1169 delete pFunc; | 1173 delete pFunc; |
1170 FX_Free(pTransfer); | 1174 FX_Free(pTransfer); |
1171 return pMask; | 1175 return pMask; |
1172 } | 1176 } |
OLD | NEW |