| 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 "dib_int.h" | 8 #include "dib_int.h" |
| 9 int SDP_Table[513] = { | 9 int SDP_Table[513] = { |
| 10 256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255, 2
54, 254, 254, 254, | 10 256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255, 2
54, 254, 254, 254, |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 *dest_scan = *src_pixel; | 531 *dest_scan = *src_pixel; |
| 532 } | 532 } |
| 533 dest_scan ++; | 533 dest_scan ++; |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 } else { | 537 } else { |
| 538 int Bpp = m_Storer.GetBitmap()->GetBPP() / 8; | 538 int Bpp = m_Storer.GetBitmap()->GetBPP() / 8; |
| 539 int destBpp = pTransformed->GetBPP() / 8; | 539 int destBpp = pTransformed->GetBPP() / 8; |
| 540 if (Bpp == 1) { | 540 if (Bpp == 1) { |
| 541 FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha(); | |
| 542 FX_DWORD argb[256]; | 541 FX_DWORD argb[256]; |
| 543 FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette(); | 542 FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette(); |
| 544 if (pPal) { | 543 if (pPal) { |
| 545 for (int i = 0; i < 256; i ++) { | 544 for (int i = 0; i < 256; i ++) { |
| 546 argb[i] = pPal[i]; | 545 argb[i] = pPal[i]; |
| 547 } | 546 } |
| 548 } else { | 547 } else { |
| 549 if (m_Storer.GetBitmap()->IsCmykImage()) | 548 if (m_Storer.GetBitmap()->IsCmykImage()) |
| 550 for (int i = 0; i < 256; i ++) { | 549 for (int i = 0; i < 256; i ++) { |
| 551 argb[i] = 255 - i; | 550 argb[i] = 255 - i; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 } | 787 } |
| 789 dest_pos += destBpp; | 788 dest_pos += destBpp; |
| 790 } | 789 } |
| 791 } | 790 } |
| 792 } | 791 } |
| 793 } | 792 } |
| 794 } | 793 } |
| 795 m_Storer.Replace(pTransformed); | 794 m_Storer.Replace(pTransformed); |
| 796 return FALSE; | 795 return FALSE; |
| 797 } | 796 } |
| OLD | NEW |