| 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/fxcodec/include/fx_codec.h" | 7 #include "core/fxcodec/include/fx_codec.h" |
| 8 #include "core/fxge/include/fx_dib.h" | 8 #include "core/fxge/include/fx_dib.h" |
| 9 #include "core/fxge/include/fx_ge.h" | 9 #include "core/fxge/include/fx_ge.h" |
| 10 | 10 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 plt[1] = FXCMYK_TODIB(src_plt[1]); | 185 plt[1] = FXCMYK_TODIB(src_plt[1]); |
| 186 } else { | 186 } else { |
| 187 uint8_t* bgr_ptr = (uint8_t*)plt; | 187 uint8_t* bgr_ptr = (uint8_t*)plt; |
| 188 bgr_ptr[0] = FXARGB_B(src_plt[0]); | 188 bgr_ptr[0] = FXARGB_B(src_plt[0]); |
| 189 bgr_ptr[1] = FXARGB_G(src_plt[0]); | 189 bgr_ptr[1] = FXARGB_G(src_plt[0]); |
| 190 bgr_ptr[2] = FXARGB_R(src_plt[0]); | 190 bgr_ptr[2] = FXARGB_R(src_plt[0]); |
| 191 bgr_ptr[3] = FXARGB_B(src_plt[1]); | 191 bgr_ptr[3] = FXARGB_B(src_plt[1]); |
| 192 bgr_ptr[4] = FXARGB_G(src_plt[1]); | 192 bgr_ptr[4] = FXARGB_G(src_plt[1]); |
| 193 bgr_ptr[5] = FXARGB_R(src_plt[1]); | 193 bgr_ptr[5] = FXARGB_R(src_plt[1]); |
| 194 } | 194 } |
| 195 ICodec_IccModule* pIccModule = | 195 CCodec_IccModule* pIccModule = |
| 196 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 196 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 197 pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 2); | 197 pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 2); |
| 198 } else { | 198 } else { |
| 199 uint8_t reset_r, reset_g, reset_b, set_r, set_g, set_b; | 199 uint8_t reset_r, reset_g, reset_b, set_r, set_g, set_b; |
| 200 if (pSrcBitmap->IsCmykImage()) { | 200 if (pSrcBitmap->IsCmykImage()) { |
| 201 AdobeCMYK_to_sRGB1( | 201 AdobeCMYK_to_sRGB1( |
| 202 FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), | 202 FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), |
| 203 FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]), reset_r, | 203 FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]), reset_r, |
| 204 reset_g, reset_b); | 204 reset_g, reset_b); |
| 205 AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), | 205 AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 plt[i] = FXCMYK_TODIB(src_plt[i]); | 247 plt[i] = FXCMYK_TODIB(src_plt[i]); |
| 248 } | 248 } |
| 249 } else { | 249 } else { |
| 250 uint8_t* bgr_ptr = (uint8_t*)plt; | 250 uint8_t* bgr_ptr = (uint8_t*)plt; |
| 251 for (int i = 0; i < 256; i++) { | 251 for (int i = 0; i < 256; i++) { |
| 252 *bgr_ptr++ = FXARGB_B(src_plt[i]); | 252 *bgr_ptr++ = FXARGB_B(src_plt[i]); |
| 253 *bgr_ptr++ = FXARGB_G(src_plt[i]); | 253 *bgr_ptr++ = FXARGB_G(src_plt[i]); |
| 254 *bgr_ptr++ = FXARGB_R(src_plt[i]); | 254 *bgr_ptr++ = FXARGB_R(src_plt[i]); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 ICodec_IccModule* pIccModule = | 257 CCodec_IccModule* pIccModule = |
| 258 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 258 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 259 pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, | 259 pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, |
| 260 256); | 260 256); |
| 261 } else { | 261 } else { |
| 262 if (pSrcBitmap->IsCmykImage()) { | 262 if (pSrcBitmap->IsCmykImage()) { |
| 263 uint8_t r, g, b; | 263 uint8_t r, g, b; |
| 264 for (int i = 0; i < 256; i++) { | 264 for (int i = 0; i < 256; i++) { |
| 265 AdobeCMYK_to_sRGB1( | 265 AdobeCMYK_to_sRGB1( |
| 266 FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), | 266 FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), |
| 267 FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), r, g, b); | 267 FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), r, g, b); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 286 FX_BOOL ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, | 286 FX_BOOL ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, |
| 287 int dest_pitch, | 287 int dest_pitch, |
| 288 int width, | 288 int width, |
| 289 int height, | 289 int height, |
| 290 const CFX_DIBSource* pSrcBitmap, | 290 const CFX_DIBSource* pSrcBitmap, |
| 291 int src_left, | 291 int src_left, |
| 292 int src_top, | 292 int src_top, |
| 293 void* pIccTransform) { | 293 void* pIccTransform) { |
| 294 int Bpp = pSrcBitmap->GetBPP() / 8; | 294 int Bpp = pSrcBitmap->GetBPP() / 8; |
| 295 if (pIccTransform) { | 295 if (pIccTransform) { |
| 296 ICodec_IccModule* pIccModule = | 296 CCodec_IccModule* pIccModule = |
| 297 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 297 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 298 if (Bpp == 3 || pSrcBitmap->IsCmykImage()) { | 298 if (Bpp == 3 || pSrcBitmap->IsCmykImage()) { |
| 299 for (int row = 0; row < height; row++) { | 299 for (int row = 0; row < height; row++) { |
| 300 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 300 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| 301 const uint8_t* src_scan = | 301 const uint8_t* src_scan = |
| 302 pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp; | 302 pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp; |
| 303 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, | 303 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, |
| 304 width); | 304 width); |
| 305 } | 305 } |
| 306 } else { | 306 } else { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 plt[i] = FXCMYK_TODIB(src_plt[i]); | 394 plt[i] = FXCMYK_TODIB(src_plt[i]); |
| 395 } | 395 } |
| 396 } else { | 396 } else { |
| 397 for (int i = 0; i < plt_size; i++) { | 397 for (int i = 0; i < plt_size; i++) { |
| 398 *bgr_ptr++ = FXARGB_B(src_plt[i]); | 398 *bgr_ptr++ = FXARGB_B(src_plt[i]); |
| 399 *bgr_ptr++ = FXARGB_G(src_plt[i]); | 399 *bgr_ptr++ = FXARGB_G(src_plt[i]); |
| 400 *bgr_ptr++ = FXARGB_R(src_plt[i]); | 400 *bgr_ptr++ = FXARGB_R(src_plt[i]); |
| 401 } | 401 } |
| 402 bgr_ptr = (uint8_t*)plt; | 402 bgr_ptr = (uint8_t*)plt; |
| 403 } | 403 } |
| 404 ICodec_IccModule* pIccModule = | 404 CCodec_IccModule* pIccModule = |
| 405 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 405 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 406 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, | 406 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, |
| 407 (const uint8_t*)plt, plt_size); | 407 (const uint8_t*)plt, plt_size); |
| 408 for (int i = 0; i < plt_size; i++) { | 408 for (int i = 0; i < plt_size; i++) { |
| 409 dst_plt[i] = FXARGB_MAKE(0xff, bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]); | 409 dst_plt[i] = FXARGB_MAKE(0xff, bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]); |
| 410 bgr_ptr += 3; | 410 bgr_ptr += 3; |
| 411 } | 411 } |
| 412 } else { | 412 } else { |
| 413 if (pSrcBitmap->IsCmykImage()) { | 413 if (pSrcBitmap->IsCmykImage()) { |
| 414 for (int i = 0; i < plt_size; i++) { | 414 for (int i = 0; i < plt_size; i++) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 int height, | 492 int height, |
| 493 const CFX_DIBSource* pSrcBitmap, | 493 const CFX_DIBSource* pSrcBitmap, |
| 494 int src_left, | 494 int src_left, |
| 495 int src_top, | 495 int src_top, |
| 496 uint32_t* dst_plt, | 496 uint32_t* dst_plt, |
| 497 void* pIccTransform) { | 497 void* pIccTransform) { |
| 498 FX_BOOL ret = ConvertBuffer_Rgb2PltRgb8_NoTransform( | 498 FX_BOOL ret = ConvertBuffer_Rgb2PltRgb8_NoTransform( |
| 499 dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, | 499 dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, |
| 500 dst_plt); | 500 dst_plt); |
| 501 if (ret && pIccTransform) { | 501 if (ret && pIccTransform) { |
| 502 ICodec_IccModule* pIccModule = | 502 CCodec_IccModule* pIccModule = |
| 503 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 503 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 504 for (int i = 0; i < 256; i++) { | 504 for (int i = 0; i < 256; i++) { |
| 505 FX_ARGB* plt = dst_plt + i; | 505 FX_ARGB* plt = dst_plt + i; |
| 506 FX_ARGB plt_entry = FXARGB_TODIB(*plt); | 506 FX_ARGB plt_entry = FXARGB_TODIB(*plt); |
| 507 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&plt_entry, | 507 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&plt_entry, |
| 508 (const uint8_t*)&plt_entry, 1); | 508 (const uint8_t*)&plt_entry, 1); |
| 509 *plt = FXARGB_TODIB(plt_entry); | 509 *plt = FXARGB_TODIB(plt_entry); |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 return ret; | 512 return ret; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 plt[1] = FXCMYK_TODIB(src_plt[1]); | 582 plt[1] = FXCMYK_TODIB(src_plt[1]); |
| 583 } else { | 583 } else { |
| 584 bgr_ptr[0] = FXARGB_B(src_plt[0]); | 584 bgr_ptr[0] = FXARGB_B(src_plt[0]); |
| 585 bgr_ptr[1] = FXARGB_G(src_plt[0]); | 585 bgr_ptr[1] = FXARGB_G(src_plt[0]); |
| 586 bgr_ptr[2] = FXARGB_R(src_plt[0]); | 586 bgr_ptr[2] = FXARGB_R(src_plt[0]); |
| 587 bgr_ptr[3] = FXARGB_B(src_plt[1]); | 587 bgr_ptr[3] = FXARGB_B(src_plt[1]); |
| 588 bgr_ptr[4] = FXARGB_G(src_plt[1]); | 588 bgr_ptr[4] = FXARGB_G(src_plt[1]); |
| 589 bgr_ptr[5] = FXARGB_R(src_plt[1]); | 589 bgr_ptr[5] = FXARGB_R(src_plt[1]); |
| 590 } | 590 } |
| 591 if (pIccTransform) { | 591 if (pIccTransform) { |
| 592 ICodec_IccModule* pIccModule = | 592 CCodec_IccModule* pIccModule = |
| 593 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 593 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 594 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, | 594 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, |
| 595 (const uint8_t*)plt, 2); | 595 (const uint8_t*)plt, 2); |
| 596 } else { | 596 } else { |
| 597 if (pSrcBitmap->IsCmykImage()) { | 597 if (pSrcBitmap->IsCmykImage()) { |
| 598 AdobeCMYK_to_sRGB1( | 598 AdobeCMYK_to_sRGB1( |
| 599 FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), | 599 FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), |
| 600 FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]), bgr_ptr[2], | 600 FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]), bgr_ptr[2], |
| 601 bgr_ptr[1], bgr_ptr[0]); | 601 bgr_ptr[1], bgr_ptr[0]); |
| 602 AdobeCMYK_to_sRGB1( | 602 AdobeCMYK_to_sRGB1( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 *bgr_ptr++ = FXARGB_R(src_plt[i]); | 643 *bgr_ptr++ = FXARGB_R(src_plt[i]); |
| 644 } | 644 } |
| 645 bgr_ptr = (uint8_t*)plt; | 645 bgr_ptr = (uint8_t*)plt; |
| 646 } | 646 } |
| 647 if (pIccTransform) { | 647 if (pIccTransform) { |
| 648 if (pSrcBitmap->IsCmykImage()) { | 648 if (pSrcBitmap->IsCmykImage()) { |
| 649 for (int i = 0; i < 256; i++) { | 649 for (int i = 0; i < 256; i++) { |
| 650 plt[i] = FXCMYK_TODIB(src_plt[i]); | 650 plt[i] = FXCMYK_TODIB(src_plt[i]); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 ICodec_IccModule* pIccModule = | 653 CCodec_IccModule* pIccModule = |
| 654 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 654 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 655 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, | 655 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, |
| 656 (const uint8_t*)plt, 256); | 656 (const uint8_t*)plt, 256); |
| 657 } else { | 657 } else { |
| 658 if (pSrcBitmap->IsCmykImage()) { | 658 if (pSrcBitmap->IsCmykImage()) { |
| 659 for (int i = 0; i < 256; i++) { | 659 for (int i = 0; i < 256; i++) { |
| 660 AdobeCMYK_to_sRGB1( | 660 AdobeCMYK_to_sRGB1( |
| 661 FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), | 661 FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), |
| 662 FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), | 662 FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]), |
| 663 bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]); | 663 bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 681 } | 681 } |
| 682 FX_BOOL ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, | 682 FX_BOOL ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, |
| 683 int dest_pitch, | 683 int dest_pitch, |
| 684 int width, | 684 int width, |
| 685 int height, | 685 int height, |
| 686 const CFX_DIBSource* pSrcBitmap, | 686 const CFX_DIBSource* pSrcBitmap, |
| 687 int src_left, | 687 int src_left, |
| 688 int src_top, | 688 int src_top, |
| 689 void* pIccTransform) { | 689 void* pIccTransform) { |
| 690 if (pIccTransform) { | 690 if (pIccTransform) { |
| 691 ICodec_IccModule* pIccModule = | 691 CCodec_IccModule* pIccModule = |
| 692 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 692 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 693 for (int row = 0; row < height; row++) { | 693 for (int row = 0; row < height; row++) { |
| 694 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 694 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| 695 const uint8_t* src_scan = | 695 const uint8_t* src_scan = |
| 696 pSrcBitmap->GetScanline(src_top + row) + src_left * 3; | 696 pSrcBitmap->GetScanline(src_top + row) + src_left * 3; |
| 697 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width); | 697 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width); |
| 698 } | 698 } |
| 699 } else { | 699 } else { |
| 700 for (int row = 0; row < height; row++) { | 700 for (int row = 0; row < height; row++) { |
| 701 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 701 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 719 const uint8_t* src_scan = | 719 const uint8_t* src_scan = |
| 720 pSrcBitmap->GetScanline(src_top + row) + src_left * 4; | 720 pSrcBitmap->GetScanline(src_top + row) + src_left * 4; |
| 721 for (int col = 0; col < width; col++) { | 721 for (int col = 0; col < width; col++) { |
| 722 *dest_scan++ = *src_scan++; | 722 *dest_scan++ = *src_scan++; |
| 723 *dest_scan++ = *src_scan++; | 723 *dest_scan++ = *src_scan++; |
| 724 *dest_scan++ = *src_scan++; | 724 *dest_scan++ = *src_scan++; |
| 725 src_scan++; | 725 src_scan++; |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 if (pIccTransform) { | 728 if (pIccTransform) { |
| 729 ICodec_IccModule* pIccModule = | 729 CCodec_IccModule* pIccModule = |
| 730 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 730 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 731 for (int row = 0; row < height; row++) { | 731 for (int row = 0; row < height; row++) { |
| 732 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 732 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| 733 pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width); | 733 pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width); |
| 734 } | 734 } |
| 735 } | 735 } |
| 736 return TRUE; | 736 return TRUE; |
| 737 } | 737 } |
| 738 FX_BOOL ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, | 738 FX_BOOL ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, |
| 739 int dest_pitch, | 739 int dest_pitch, |
| 740 int width, | 740 int width, |
| 741 int height, | 741 int height, |
| 742 const CFX_DIBSource* pSrcBitmap, | 742 const CFX_DIBSource* pSrcBitmap, |
| 743 int src_left, | 743 int src_left, |
| 744 int src_top, | 744 int src_top, |
| 745 void* pIccTransform) { | 745 void* pIccTransform) { |
| 746 int comps = pSrcBitmap->GetBPP() / 8; | 746 int comps = pSrcBitmap->GetBPP() / 8; |
| 747 if (pIccTransform) { | 747 if (pIccTransform) { |
| 748 ICodec_IccModule* pIccModule = | 748 CCodec_IccModule* pIccModule = |
| 749 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 749 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 750 for (int row = 0; row < height; row++) { | 750 for (int row = 0; row < height; row++) { |
| 751 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 751 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| 752 const uint8_t* src_scan = | 752 const uint8_t* src_scan = |
| 753 pSrcBitmap->GetScanline(src_top + row) + src_left * comps; | 753 pSrcBitmap->GetScanline(src_top + row) + src_left * comps; |
| 754 for (int col = 0; col < width; col++) { | 754 for (int col = 0; col < width; col++) { |
| 755 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1); | 755 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1); |
| 756 dest_scan += 4; | 756 dest_scan += 4; |
| 757 src_scan += comps; | 757 src_scan += comps; |
| 758 } | 758 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 775 } | 775 } |
| 776 FX_BOOL ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, | 776 FX_BOOL ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, |
| 777 int dest_pitch, | 777 int dest_pitch, |
| 778 int width, | 778 int width, |
| 779 int height, | 779 int height, |
| 780 const CFX_DIBSource* pSrcBitmap, | 780 const CFX_DIBSource* pSrcBitmap, |
| 781 int src_left, | 781 int src_left, |
| 782 int src_top, | 782 int src_top, |
| 783 void* pIccTransform) { | 783 void* pIccTransform) { |
| 784 if (pIccTransform) { | 784 if (pIccTransform) { |
| 785 ICodec_IccModule* pIccModule = | 785 CCodec_IccModule* pIccModule = |
| 786 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 786 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
| 787 for (int row = 0; row < height; row++) { | 787 for (int row = 0; row < height; row++) { |
| 788 uint8_t* dest_scan = dest_buf + row * dest_pitch; | 788 uint8_t* dest_scan = dest_buf + row * dest_pitch; |
| 789 const uint8_t* src_scan = | 789 const uint8_t* src_scan = |
| 790 pSrcBitmap->GetScanline(src_top + row) + src_left * 4; | 790 pSrcBitmap->GetScanline(src_top + row) + src_left * 4; |
| 791 for (int col = 0; col < width; col++) { | 791 for (int col = 0; col < width; col++) { |
| 792 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1); | 792 pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1); |
| 793 dest_scan += 4; | 793 dest_scan += 4; |
| 794 src_scan += 4; | 794 src_scan += 4; |
| 795 } | 795 } |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 if (!m_bExtBuf) { | 1095 if (!m_bExtBuf) { |
| 1096 FX_Free(m_pBuffer); | 1096 FX_Free(m_pBuffer); |
| 1097 } | 1097 } |
| 1098 m_bExtBuf = FALSE; | 1098 m_bExtBuf = FALSE; |
| 1099 m_pBuffer = dest_buf; | 1099 m_pBuffer = dest_buf; |
| 1100 m_bpp = (uint8_t)dest_format; | 1100 m_bpp = (uint8_t)dest_format; |
| 1101 m_AlphaFlag = (uint8_t)(dest_format >> 8); | 1101 m_AlphaFlag = (uint8_t)(dest_format >> 8); |
| 1102 m_Pitch = dest_pitch; | 1102 m_Pitch = dest_pitch; |
| 1103 return TRUE; | 1103 return TRUE; |
| 1104 } | 1104 } |
| OLD | NEW |