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/fxge/fx_dib.h" | 7 #include "../../../include/fxge/fx_dib.h" |
8 #include "../../../include/fxge/fx_ge.h" | 8 #include "../../../include/fxge/fx_ge.h" |
9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 const FX_DWORD g_dwWinPalette[256] = { | 10 const FX_DWORD g_dwWinPalette[256] = { |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 break; | 578 break; |
579 } | 579 } |
580 } | 580 } |
581 } | 581 } |
582 FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256); | 582 FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256); |
583 return TRUE; | 583 return TRUE; |
584 } | 584 } |
585 FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
, int height, | 585 FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
, int height, |
586 const CFX_DIBSource* pSrcBitmap, int src_left
, int src_top, FX_DWORD* dst_plt, void* pIccTransform) | 586 const CFX_DIBSource* pSrcBitmap, int src_left
, int src_top, FX_DWORD* dst_plt, void* pIccTransform) |
587 { | 587 { |
588 ICodec_IccModule* pIccModule = NULL; | |
589 if (pIccTransform) { | |
590 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | |
591 } | |
592 FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, w
idth, height, pSrcBitmap, src_left, src_top, dst_plt); | 588 FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, w
idth, height, pSrcBitmap, src_left, src_top, dst_plt); |
593 if (ret && pIccTransform) { | 589 if (ret && pIccTransform) { |
594 ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->Ge
tIccModule(); | 590 ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->Ge
tIccModule(); |
595 for (int i = 0; i < 256; i++) { | 591 for (int i = 0; i < 256; i++) { |
596 FX_ARGB* plt = dst_plt + i; | 592 FX_ARGB* plt = dst_plt + i; |
597 FX_ARGB plt_entry = FXARGB_TODIB(*plt); | 593 FX_ARGB plt_entry = FXARGB_TODIB(*plt); |
598 pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&plt_entry,
(FX_LPCBYTE)&plt_entry, 1); | 594 pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&plt_entry,
(FX_LPCBYTE)&plt_entry, 1); |
599 *plt = FXARGB_TODIB(plt_entry); | 595 *plt = FXARGB_TODIB(plt_entry); |
600 } | 596 } |
601 } | 597 } |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 if (!m_bExtBuf) { | 1074 if (!m_bExtBuf) { |
1079 FX_Free(m_pBuffer); | 1075 FX_Free(m_pBuffer); |
1080 } | 1076 } |
1081 m_bExtBuf = FALSE; | 1077 m_bExtBuf = FALSE; |
1082 m_pBuffer = dest_buf; | 1078 m_pBuffer = dest_buf; |
1083 m_bpp = (FX_BYTE)dest_format; | 1079 m_bpp = (FX_BYTE)dest_format; |
1084 m_AlphaFlag = (FX_BYTE)(dest_format >> 8); | 1080 m_AlphaFlag = (FX_BYTE)(dest_format >> 8); |
1085 m_Pitch = dest_pitch; | 1081 m_Pitch = dest_pitch; |
1086 return TRUE; | 1082 return TRUE; |
1087 } | 1083 } |
OLD | NEW |