| 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/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> |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { | 172 FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { |
| 173 if (m_pSrc->IsAlphaMask()) { | 173 if (m_pSrc->IsAlphaMask()) { |
| 174 return FXDIB_8bppMask; | 174 return FXDIB_8bppMask; |
| 175 } | 175 } |
| 176 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 176 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 177 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; | 177 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; |
| 178 #else | 178 #else |
| 179 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; | 179 return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; |
| 180 #endif | 180 #endif |
| 181 } | 181 } |
| 182 |
| 183 FX_ARGB* CPDF_DIBTransferFunc::GetDestPalette() { |
| 184 return nullptr; |
| 185 } |
| 186 |
| 182 CPDF_DIBTransferFunc::CPDF_DIBTransferFunc( | 187 CPDF_DIBTransferFunc::CPDF_DIBTransferFunc( |
| 183 const CPDF_TransferFunc* pTransferFunc) { | 188 const CPDF_TransferFunc* pTransferFunc) { |
| 184 m_RampR = pTransferFunc->m_Samples; | 189 m_RampR = pTransferFunc->m_Samples; |
| 185 m_RampG = &pTransferFunc->m_Samples[256]; | 190 m_RampG = &pTransferFunc->m_Samples[256]; |
| 186 m_RampB = &pTransferFunc->m_Samples[512]; | 191 m_RampB = &pTransferFunc->m_Samples[512]; |
| 187 } | 192 } |
| 188 void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, | 193 void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, |
| 189 const uint8_t* src_buf) const { | 194 const uint8_t* src_buf) const { |
| 190 int i; | 195 int i; |
| 191 FX_BOOL bSkip = FALSE; | 196 FX_BOOL bSkip = FALSE; |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 } else if (pFunc) { | 1015 } else if (pFunc) { |
| 1011 int size = dest_pitch * height; | 1016 int size = dest_pitch * height; |
| 1012 for (int i = 0; i < size; i++) { | 1017 for (int i = 0; i < size; i++) { |
| 1013 dest_buf[i] = transfers[src_buf[i]]; | 1018 dest_buf[i] = transfers[src_buf[i]]; |
| 1014 } | 1019 } |
| 1015 } else { | 1020 } else { |
| 1016 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1021 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
| 1017 } | 1022 } |
| 1018 return pMask.release(); | 1023 return pMask.release(); |
| 1019 } | 1024 } |
| OLD | NEW |