| 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/include/fxcodec/fx_codec.h" | 7 #include "core/include/fxcodec/fx_codec.h" |
| 8 #include "core/include/fxge/fx_dib.h" | 8 #include "core/include/fxge/fx_dib.h" |
| 9 #include "core/include/fxge/fx_ge.h" | 9 #include "core/include/fxge/fx_ge.h" |
| 10 | 10 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 } | 610 } |
| 611 FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, | 611 FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, |
| 612 int dest_pitch, | 612 int dest_pitch, |
| 613 int width, | 613 int width, |
| 614 int height, | 614 int height, |
| 615 const CFX_DIBSource* pSrcBitmap, | 615 const CFX_DIBSource* pSrcBitmap, |
| 616 int src_left, | 616 int src_left, |
| 617 int src_top, | 617 int src_top, |
| 618 FX_DWORD* dst_plt, | 618 FX_DWORD* dst_plt, |
| 619 void* pIccTransform) { | 619 void* pIccTransform) { |
| 620 #ifdef PDF_ENABLE_XFA |
| 620 ICodec_IccModule* pIccModule = NULL; | 621 ICodec_IccModule* pIccModule = NULL; |
| 621 if (pIccTransform) { | 622 if (pIccTransform) { |
| 622 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 623 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 623 } | 624 } |
| 625 #endif |
| 624 FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform( | 626 FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform( |
| 625 dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, | 627 dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, |
| 626 dst_plt); | 628 dst_plt); |
| 627 if (ret && pIccTransform) { | 629 if (ret && pIccTransform) { |
| 628 ICodec_IccModule* pIccModule = | 630 ICodec_IccModule* pIccModule = |
| 629 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 631 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 630 for (int i = 0; i < 256; i++) { | 632 for (int i = 0; i < 256; i++) { |
| 631 FX_ARGB* plt = dst_plt + i; | 633 FX_ARGB* plt = dst_plt + i; |
| 632 FX_ARGB plt_entry = FXARGB_TODIB(*plt); | 634 FX_ARGB plt_entry = FXARGB_TODIB(*plt); |
| 633 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&plt_entry, | 635 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&plt_entry, |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 if (!m_bExtBuf) { | 1224 if (!m_bExtBuf) { |
| 1223 FX_Free(m_pBuffer); | 1225 FX_Free(m_pBuffer); |
| 1224 } | 1226 } |
| 1225 m_bExtBuf = FALSE; | 1227 m_bExtBuf = FALSE; |
| 1226 m_pBuffer = dest_buf; | 1228 m_pBuffer = dest_buf; |
| 1227 m_bpp = (uint8_t)dest_format; | 1229 m_bpp = (uint8_t)dest_format; |
| 1228 m_AlphaFlag = (uint8_t)(dest_format >> 8); | 1230 m_AlphaFlag = (uint8_t)(dest_format >> 8); |
| 1229 m_Pitch = dest_pitch; | 1231 m_Pitch = dest_pitch; |
| 1230 return TRUE; | 1232 return TRUE; |
| 1231 } | 1233 } |
| OLD | NEW |